From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: rmail-toggle-header problem Date: Thu, 19 Feb 2009 21:12:05 -0500 Message-ID: References: <1sbpsyf9y4.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1235096070 4264 80.91.229.12 (20 Feb 2009 02:14:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Feb 2009 02:14:30 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 20 03:15:45 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LaKvY-0007dI-SD for ged-emacs-devel@m.gmane.org; Fri, 20 Feb 2009 03:15:45 +0100 Original-Received: from localhost ([127.0.0.1]:44700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaKuE-0007vo-Im for ged-emacs-devel@m.gmane.org; Thu, 19 Feb 2009 21:14:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaKu9-0007vM-UK for emacs-devel@gnu.org; Thu, 19 Feb 2009 21:14:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaKu8-0007uu-88 for emacs-devel@gnu.org; Thu, 19 Feb 2009 21:14:17 -0500 Original-Received: from [199.232.76.173] (port=48303 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaKu8-0007ur-1Z for emacs-devel@gnu.org; Thu, 19 Feb 2009 21:14:16 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:54261) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LaKu7-0001oW-M1 for emacs-devel@gnu.org; Thu, 19 Feb 2009 21:14:15 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LaKs1-0006Yq-IJ; Thu, 19 Feb 2009 21:12:05 -0500 X-Spook: Fortezza Armani Telex eavesdropping PGP spies EuroFed X-Ran: WX,8[(uU||rN)1~uH#r?2hTs@Us..atd'p#HW=O]%#8tNS/a!.b8fFg'7c9s1,`S@d7=R6 X-Hue: yellow X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109239 Archived-At: Kenichi Handa wrote: > The reason of toggling is just to see the full headers. Understood. > I don't intend to yank the full headers when I type r to reply, and > type C-c C-y to yank. Actually supercite deletes all headers. (depends on what supercite options you use) Rmail should behave sensibly when supercite is not used. So should it not yank the headers at all? Should it always yank the "condensed" headers? Should it yank the headers as displayed (the current behaviour)? Should it exclude "X-RMAIL"? Etc... I have no opinion, I'm wondering what Rmail users want. If they don't care, then just changing supercite is fine. >> Separately, I also don't know whether supercite should be changed as >> was suggested. > > I don't mind how the problem is fixed, but with your patch, > I get the error "Marker does not point anywhere" when I type > C-c C-y. Hmph. insert-buffer pushes a mark, whilst insert-buffer-substring does not. *** rmail.el 19 Feb 2009 03:30:41 -0000 1.510 --- rmail.el 20 Feb 2009 02:03:17 -0000 *************** *** 3222,3232 **** ;;;; *** Rmail Mailing Commands *** (defun rmail-start-mail (&optional noerase to subject in-reply-to cc replybuffer sendactions same-window others) (let (yank-action) (if replybuffer ! (setq yank-action (list 'insert-buffer replybuffer))) (setq others (cons (cons "cc" cc) others)) (setq others (cons (cons "in-reply-to" in-reply-to) others)) (if same-window --- 3222,3248 ---- ;;;; *** Rmail Mailing Commands *** + ;; If full headers are visible, don't yank the leading From line. + ;; Eg supercite complains (but it's not clear if it should or not). + ;; http://lists.gnu.org/archive/html/emacs-devel/2009-02/msg00691.html + (defun rmail-reply-insert-buffer (buffer) + "Like `insert-buffer', but skips the leading From line, if present." + (push-mark + (save-excursion + (insert-buffer-substring buffer (with-current-buffer buffer + (save-excursion + (goto-char (point-min)) + (if (looking-at "^From ") + (forward-line 1)) + (point)))) + (point))) + nil) + (defun rmail-start-mail (&optional noerase to subject in-reply-to cc replybuffer sendactions same-window others) (let (yank-action) (if replybuffer ! (setq yank-action (list 'rmail-reply-insert-buffer replybuffer))) (setq others (cons (cons "cc" cc) others)) (setq others (cons (cons "in-reply-to" in-reply-to) others)) (if same-window