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 15:28:19 -0500 Message-ID: <1sbpsyf9y4.fsf@fencepost.gnu.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1235075480 10786 80.91.229.12 (19 Feb 2009 20:31:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2009 20:31:20 +0000 (UTC) Cc: emacs-devel@gnu.org, Kenichi Handa To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 19 21:32:36 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 1LaFZH-0004S7-1t for ged-emacs-devel@m.gmane.org; Thu, 19 Feb 2009 21:32:23 +0100 Original-Received: from localhost ([127.0.0.1]:57309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaFXw-000875-SJ for ged-emacs-devel@m.gmane.org; Thu, 19 Feb 2009 15:31:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaFXU-0007wG-8q for emacs-devel@gnu.org; Thu, 19 Feb 2009 15:30:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaFXS-0007vm-L1 for emacs-devel@gnu.org; Thu, 19 Feb 2009 15:30:30 -0500 Original-Received: from [199.232.76.173] (port=32830 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaFXS-0007vj-HU for emacs-devel@gnu.org; Thu, 19 Feb 2009 15:30:30 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:46070) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LaFXS-0005me-6g for emacs-devel@gnu.org; Thu, 19 Feb 2009 15:30:30 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LaFVL-0006MY-Mo; Thu, 19 Feb 2009 15:28:19 -0500 X-Spook: Chobetsu pipeline Al Jazeera SRI number key LABLINK Saudi X-Ran: :0F;,z7hHfHdofQE)FRd (Richard M. Stallman's message of "Wed, 18 Feb 2009 07:10:33 -0500") 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:109232 Archived-At: Richard M Stallman wrote: > And, the first "From ..." line is also shown. Shouldn't that > line be hidden? At least, C-c C-y (mail-yank-original) signals > this error: > > I am not sure whether it is better to omit that line > or change mail-yank-original. I think Rmail might as well show the leading From line when full headers are visible. It's simple to change mail-yank-original's behaviour (see below). I'm not sure that yanking from the full headers makes a lot of sense, though. Eg it includes the X-RMAIL headers in the yank. Would you ever want to include the full headers (all the Received: etc) in a reply? Separately, I also don't know whether supercite should be changed as was suggested. *** rmail.el 19 Feb 2009 03:30:41 -0000 1.510 --- rmail.el 19 Feb 2009 20:23:16 -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,3244 ---- ;;;; *** 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." + (insert-buffer-substring buffer (with-current-buffer buffer + (save-excursion + (goto-char (point-min)) + (if (looking-at "^From ") + (forward-line 1)) + (point))))) + (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