unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Kenichi Handa <handa@m17n.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: rmail-toggle-header problem
Date: Thu, 19 Feb 2009 21:12:05 -0500	[thread overview]
Message-ID: <wj3ae9j1qi.fsf@fencepost.gnu.org> (raw)
In-Reply-To: E1LaKIQ-0002o8-Hy@etlken

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 ****
  \f
  ;;;; *** 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 ----
  \f
  ;;;; *** 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




  reply	other threads:[~2009-02-20  2:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-18  2:26 rmail-toggle-header problem Kenichi Handa
2009-02-18  5:29 ` Glenn Morris
2009-02-18  6:37   ` Kenichi Handa
2009-02-18 12:10 ` Richard M Stallman
2009-02-19 20:28   ` Glenn Morris
2009-02-20  1:35     ` Kenichi Handa
2009-02-20  2:12       ` Glenn Morris [this message]
2009-02-20  8:34         ` Eli Zaretskii
2009-02-20  8:29       ` Eli Zaretskii
2009-02-20 12:59         ` Kenichi Handa
2009-02-20 13:30     ` Richard M Stallman
2009-02-20 22:21       ` Chetan Pandya
2009-02-21  2:34         ` Stephen J. Turnbull
2009-02-21  1:18       ` Chetan Pandya
2009-02-21  2:21         ` Stefan Monnier
2009-02-21  3:18       ` Glenn Morris
2009-02-21  9:12         ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2009-02-20  9:35 Alfred M. Szmidt
2009-02-22  9:25 Xavier Maillard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wj3ae9j1qi.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).