info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature Request: Message-elide-region showing lines snipped and taki


From: Reiner Steib
Subject: Re: Feature Request: Message-elide-region showing lines snipped and taking a string
Date: Thu, 25 Dec 2008 14:32:43 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux)

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))))))

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]