From 1744f2fbe4c382d63068903cd867804bd2485d3e Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 14 Jan 2004 21:57:57 +0000 Subject: [PATCH] Synch to No Gnus 200401141432. --- lisp/ChangeLog | 7 +++++++ lisp/message.el | 27 +++++++++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) 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. -- 1.7.10.4