From: Lars Magne Ingebrigtsen Date: Tue, 15 Mar 2011 19:37:01 +0000 (+0100) Subject: (message-elide-ellipsis): Document the format specs in the ellipsis. X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=698d90dfd2f1ddb5789c7a3fef3064dfe08a0c81 (message-elide-ellipsis): Document the format specs in the ellipsis. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 398086dd4..0e5895aa0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2011-03-15 Lars Magne Ingebrigtsen + + * message.el (message-elide-ellipsis): Document the format specs in the + ellipsis. + +2011-03-15 Reiner Steib + + * message.el (message-elide-region): Allow the ellipsis to say how many + lines were removed. + 2011-03-15 Lars Magne Ingebrigtsen * gnus-win.el (gnus-configure-frame): Protect against trying to restore diff --git a/lisp/message.el b/lisp/message.el index c939303b4..198c5d82c 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -49,6 +49,7 @@ (require 'mail-parse) (require 'mml) (require 'rfc822) +(require 'format-spec) (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/ @@ -442,7 +443,10 @@ whitespace)." :group 'message-various) (defcustom message-elide-ellipsis "\n[...]\n\n" - "*The string which is inserted for elided text." + "*The string which is inserted for elided text. +This is a format-spec string, and you can use %l to say how many +lines were removed, and %c to say how many characters were +removed." :type 'string :link '(custom-manual "(message)Various Commands") :group 'message-various) @@ -3579,8 +3583,12 @@ Note that this should not be used in newsgroups." An ellipsis (from `message-elide-ellipsis') will be inserted where the text was killed." (interactive "r") - (kill-region b e) - (insert message-elide-ellipsis)) + (let ((lines (count-lines b e)) + (chars (- e b))) + (kill-region b e) + (insert (format-spec message-elide-ellipsis + `((?l . ,lines) + (?c . ,chars)))))) (defvar message-caesar-translation-table nil)