Gnus development mailing list
 help / color / mirror / Atom feed
* message-kill-to-signature (&optional arg) [resend]
@ 2004-01-08 21:12 Vasily Korytov
  2004-01-14 10:51 ` Kai Grossjohann
  0 siblings, 1 reply; 5+ messages in thread
From: Vasily Korytov @ 2004-01-08 21:12 UTC (permalink / raw)


This patch has been waiting for a long time for No Gnus. =))

Sorry, I currently can't check, if this functionality has been already
implemented since then or does it apply cleanly. But anyway sending it.
--8<------------------------schnipp------------------------->8---
2003-05-11  Vasily Korytov  <deskpot@myrealbox.com>

	* message.el (message-kill-to-signature): Use an optional arg to
	specify the number of lines to keep; Add narrowing.

--- gnus/lisp/message.el	Sat May 10 19:05:12 2003
+++ lisp/message.el	Sun May 11 01:05:43 2003
@@ -2612,16 +2612,23 @@
   (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)
+  "Deletes all text up to the signature. If a numberic argument or
+prefix arg is out there, 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.
--8<------------------------schnapp------------------------->8---


-- 
       I accept RFC3156 and RFC2440-compatible encrypted mail.
PGP key fingerprint: 3273 7F6F 7B87 5DD5 9848 05FB E442 86BC 2E6B 6831




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: message-kill-to-signature (&optional arg) [resend]
  2004-01-08 21:12 message-kill-to-signature (&optional arg) [resend] Vasily Korytov
@ 2004-01-14 10:51 ` Kai Grossjohann
  2004-01-14 11:29   ` Vasily Korytov
  0 siblings, 1 reply; 5+ messages in thread
From: Kai Grossjohann @ 2004-01-14 10:51 UTC (permalink / raw)


deskpot@despammed.com (Vasily Korytov) writes:

> This patch has been waiting for a long time for No Gnus. =))

I've applied it in my working dir, but there is one remaining
question: Have you done the paperwork?

Then I'll commit.

Kai



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: message-kill-to-signature (&optional arg) [resend]
  2004-01-14 10:51 ` Kai Grossjohann
@ 2004-01-14 11:29   ` Vasily Korytov
  2004-01-14 14:33     ` Kai Grossjohann
  0 siblings, 1 reply; 5+ messages in thread
From: Vasily Korytov @ 2004-01-14 11:29 UTC (permalink / raw)


On Wed, 14 Jan 2004 11:51:01 +0100, Kai Grossjohann wrote:

> deskpot@despammed.com (Vasily Korytov) writes:
>
>> This patch has been waiting for a long time for No Gnus. =))
>
> I've applied it in my working dir, but there is one remaining
> question: Have you done the paperwork?

Well I did -- half a year ago. =))

-- 
       I accept RFC3156 and RFC2440-compatible encrypted mail.
PGP key fingerprint: 3273 7F6F 7B87 5DD5 9848 05FB E442 86BC 2E6B 6831




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: message-kill-to-signature (&optional arg) [resend]
  2004-01-14 11:29   ` Vasily Korytov
@ 2004-01-14 14:33     ` Kai Grossjohann
  2004-01-14 19:27       ` Vasily Korytov
  0 siblings, 1 reply; 5+ messages in thread
From: Kai Grossjohann @ 2004-01-14 14:33 UTC (permalink / raw)


deskpot@despammed.com (Vasily Korytov) writes:

> On Wed, 14 Jan 2004 11:51:01 +0100, Kai Grossjohann wrote:
>
>> I've applied it in my working dir, but there is one remaining
>> question: Have you done the paperwork?
>
> Well I did -- half a year ago. =))

It is rather embarrassing to have to ask so often.  I need to get back
my fencepost account.

I've applied the patch, and then I slightly tweaked the docstring.
What do you think?

Kai



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: message-kill-to-signature (&optional arg) [resend]
  2004-01-14 14:33     ` Kai Grossjohann
@ 2004-01-14 19:27       ` Vasily Korytov
  0 siblings, 0 replies; 5+ messages in thread
From: Vasily Korytov @ 2004-01-14 19:27 UTC (permalink / raw)


On Wed, 14 Jan 2004 15:33:19 +0100, Kai Grossjohann wrote:

> I've applied the patch, and then I slightly tweaked the docstring.
> What do you think?

I think, you're right with this change -- it's surely killing, not
deleting (of course, to us it's two different things). When I was
modifying the docstring, I left ``delete'' as it was before.

-- 
       I accept RFC3156 and RFC2440-compatible encrypted mail.
PGP key fingerprint: 3273 7F6F 7B87 5DD5 9848 05FB E442 86BC 2E6B 6831




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-14 19:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-08 21:12 message-kill-to-signature (&optional arg) [resend] Vasily Korytov
2004-01-14 10:51 ` Kai Grossjohann
2004-01-14 11:29   ` Vasily Korytov
2004-01-14 14:33     ` Kai Grossjohann
2004-01-14 19:27       ` Vasily Korytov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).