Author:
Date: Dec 25, 2008 05:32
On Thu, Dec 25 2008, Sivaram Neelakantan wrote:
> The key C-c C-e currently elides a region of text and produces the
> following
[snipped 6 lines, 73 chars]
> Ideally, [...] or [snipped x lines] can be made default with the
> option of the user being able to change the text.
How about the following?
(setq message-elide-ellipsis "\n[snipped %%l lines, %%c chars]\n\n")
(defun rs-message-elide-region (b e)
"Elide the text in the region.
An ellipsis (from `message-elide-ellipsis') will be inserted where the
text was killed."
(interactive "r")
(let ((lines (count-lines b e))
(chars (- e b)))
(kill-region b e)
(insert (format-spec message-elide-ellipsis
`((?l . ,lines)
(?c . ,chars))))))
|