From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/55848 Path: main.gmane.org!not-for-mail From: deskpot@despammed.com (Vasily Korytov) Newsgroups: gmane.emacs.gnus.general Subject: message-kill-to-signature (&optional arg) [resend] Date: Fri, 09 Jan 2004 00:12:48 +0300 Sender: ding-owner@lists.math.uh.edu Message-ID: <87u136uotr.fsf@unix.home.local> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1073596319 13936 80.91.224.253 (8 Jan 2004 21:11:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Jan 2004 21:11:59 +0000 (UTC) Original-X-From: ding-owner+M4388@lists.math.uh.edu Thu Jan 08 22:11:56 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AehRc-0007M1-00 for ; Thu, 08 Jan 2004 22:11:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1AehRN-0007Qd-00; Thu, 08 Jan 2004 15:11:41 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1AehRI-0007QY-00 for ding@lists.math.uh.edu; Thu, 08 Jan 2004 15:11:36 -0600 Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by justine.libertine.org (Postfix) with ESMTP id A3B483A0034 for ; Thu, 8 Jan 2004 15:11:34 -0600 (CST) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AehRF-0000EH-00 for ; Thu, 08 Jan 2004 22:11:33 +0100 Mail-Followup-To: ding@gnus.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AehRE-0000E9-00 for ; Thu, 08 Jan 2004 22:11:32 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AehRE-0003bu-00 for ; Thu, 08 Jan 2004 22:11:32 +0100 Original-Lines: 52 Original-X-Complaints-To: usenet@sea.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:fm4W7jDSxrf3xzo7ngxNb3QiQGA= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:55848 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:55848 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 * 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