From: yamaoka Date: Wed, 14 Jan 2004 21:57:57 +0000 (+0000) Subject: Synch to No Gnus 200401141432. X-Git-Tag: t-gnus-6_17_4-quimby-~1133 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1744f2fbe4c382d63068903cd867804bd2485d3e;p=elisp%2Fgnus.git- Synch to No Gnus 200401141432. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 46b3135..821ca6c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2004-01-14 Kai Grossjohann + + * message.el (message-kill-to-signature): Allow prefix arg to + specify number of lines to keep before signature. From Vasily + Korytov. + (message-kill-to-signature): Change docstring. + 2004-01-14 Katsumi Yamaoka * canlock.el: Always require sha1-el. diff --git a/lisp/message.el b/lisp/message.el index 9df4753..65c527f 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -3020,16 +3020,23 @@ or in the synonym headers, defined by `message-header-synonyms'." (when (message-goto-signature) (forward-line -2))) -(defun message-kill-to-signature () - "Deletes all text up to the signature." - (interactive) - (let ((point (point))) - (message-goto-signature) - (unless (eobp) - (end-of-line -1)) - (kill-region point (point)) - (unless (bolp) - (insert "\n")))) +(defun message-kill-to-signature (&optional arg) + "Kill all text up to the signature. +If a numberic argument or prefix arg is given, leave that number +of lines before the signature intact." + (interactive "p") + (save-excursion + (save-restriction + (let ((point (point))) + (narrow-to-region point (point-max)) + (message-goto-signature) + (unless (eobp) + (if (and arg (numberp arg)) + (forward-line (- -1 arg)) + (end-of-line -1))) + (unless (= point (point)) + (kill-region point (point)) + (insert "\n")))))) (defun message-newline-and-reformat (&optional arg not-break) "Insert four newlines, and then reformat if inside quoted text.