diff options
| author | Paul Eggert | 2012-04-20 12:17:59 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-04-20 12:17:59 -0700 |
| commit | 4b932ea214c5293ce71abf51e6b09c74eea532ce (patch) | |
| tree | e49f590473166e1cbad7222a797e50d7acc52f67 | |
| parent | 24c51a09d6150ca56383a091fc945210ff3fe673 (diff) | |
| download | emacs-4b932ea214c5293ce71abf51e6b09c74eea532ce.tar.gz emacs-4b932ea214c5293ce71abf51e6b09c74eea532ce.zip | |
Fix logic for returning to and yanking from Rmail buffer.
* mail/rmail.el (rmail-start-mail):
Pass (rmail-mail-return...) for the return-action.
Pass (rmail-yank-current-message...) for the yank-action.
(rmail-yank-current-message): New function.
(rmail-mail): Pass the Rmail buffer, not view buffer, for replybuffer.
(rmail-reply): Likewise.
(rmail-forward): Pass the Rmail buffer, not nil, for replybuffer.
* mail/sendmail.el (mail-bury): Choose the first rmail-mode
buffer, not the last. Reject temp buffers. Use the rmail-mode
buffer, not newbuf.
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/mail/rmail.el | 23 | ||||
| -rw-r--r-- | lisp/mail/sendmail.el | 5 |
3 files changed, 36 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c5c4d2573b1..8df6cbf0e1a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2012-04-20 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | Fix logic for returning to and yanking from Rmail buffer. | ||
| 4 | |||
| 5 | * mail/rmail.el (rmail-start-mail): | ||
| 6 | Pass (rmail-mail-return...) for the return-action. | ||
| 7 | Pass (rmail-yank-current-message...) for the yank-action. | ||
| 8 | (rmail-yank-current-message): New function. | ||
| 9 | (rmail-mail): Pass the Rmail buffer, not view buffer, for replybuffer. | ||
| 10 | (rmail-reply): Likewise. | ||
| 11 | (rmail-forward): Pass the Rmail buffer, not nil, for replybuffer. | ||
| 12 | |||
| 13 | * mail/sendmail.el (mail-bury): Choose the first rmail-mode | ||
| 14 | buffer, not the last. Reject temp buffers. Use the rmail-mode | ||
| 15 | buffer, not newbuf. | ||
| 16 | |||
| 1 | 2012-04-20 Eli Zaretskii <eliz@gnu.org> | 17 | 2012-04-20 Eli Zaretskii <eliz@gnu.org> |
| 2 | 18 | ||
| 3 | * progmodes/gdb-mi.el (gdb-control-level): New variable. | 19 | * progmodes/gdb-mi.el (gdb-control-level): New variable. |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 3a9ba8122ab..265347ca69a 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -3560,6 +3560,16 @@ does not pop any summary buffer." | |||
| 3560 | 3560 | ||
| 3561 | ;;;; *** Rmail Mailing Commands *** | 3561 | ;;;; *** Rmail Mailing Commands *** |
| 3562 | 3562 | ||
| 3563 | (defun rmail-yank-current-message (buffer) | ||
| 3564 | "Yank into the current buffer the current message of Rmail buffer BUFFER. | ||
| 3565 | If BUFFER is swapped with its message viewer buffer, yank out of BUFFER. | ||
| 3566 | If BUFFER is not swapped, yank out of its message viewer buffer." | ||
| 3567 | (with-current-buffer buffer | ||
| 3568 | (unless (rmail-buffers-swapped-p) | ||
| 3569 | (setq buffer rmail-view-buffer))) | ||
| 3570 | (insert-buffer buffer)) | ||
| 3571 | |||
| 3572 | |||
| 3563 | (defun rmail-start-mail (&optional noerase to subject in-reply-to cc | 3573 | (defun rmail-start-mail (&optional noerase to subject in-reply-to cc |
| 3564 | replybuffer sendactions same-window | 3574 | replybuffer sendactions same-window |
| 3565 | other-headers) | 3575 | other-headers) |
| @@ -3571,7 +3581,8 @@ does not pop any summary buffer." | |||
| 3571 | (if replybuffer | 3581 | (if replybuffer |
| 3572 | ;; The function used here must behave like insert-buffer wrt | 3582 | ;; The function used here must behave like insert-buffer wrt |
| 3573 | ;; point and mark (see doc of sc-cite-original). | 3583 | ;; point and mark (see doc of sc-cite-original). |
| 3574 | (setq yank-action (list 'insert-buffer replybuffer))) | 3584 | (setq yank-action |
| 3585 | `(rmail-yank-current-message ,replybuffer))) | ||
| 3575 | (push (cons "cc" cc) other-headers) | 3586 | (push (cons "cc" cc) other-headers) |
| 3576 | (push (cons "in-reply-to" in-reply-to) other-headers) | 3587 | (push (cons "in-reply-to" in-reply-to) other-headers) |
| 3577 | (setq other-headers | 3588 | (setq other-headers |
| @@ -3587,7 +3598,7 @@ does not pop any summary buffer." | |||
| 3587 | (prog1 | 3598 | (prog1 |
| 3588 | (compose-mail to subject other-headers noerase | 3599 | (compose-mail to subject other-headers noerase |
| 3589 | switch-function yank-action sendactions | 3600 | switch-function yank-action sendactions |
| 3590 | `(rmail-mail-return ,replybuffer)) | 3601 | (if replybuffer `(rmail-mail-return ,replybuffer))) |
| 3591 | (if (eq switch-function 'switch-to-buffer-other-frame) | 3602 | (if (eq switch-function 'switch-to-buffer-other-frame) |
| 3592 | ;; This is not a standard frame parameter; nothing except | 3603 | ;; This is not a standard frame parameter; nothing except |
| 3593 | ;; sendmail.el looks at it. | 3604 | ;; sendmail.el looks at it. |
| @@ -3644,7 +3655,7 @@ to switch to." | |||
| 3644 | While composing the message, use \\[mail-yank-original] to yank the | 3655 | While composing the message, use \\[mail-yank-original] to yank the |
| 3645 | original message into it." | 3656 | original message into it." |
| 3646 | (interactive) | 3657 | (interactive) |
| 3647 | (rmail-start-mail nil nil nil nil nil rmail-view-buffer)) | 3658 | (rmail-start-mail nil nil nil nil nil rmail-buffer)) |
| 3648 | 3659 | ||
| 3649 | ;; FIXME should complain if there is nothing to continue. | 3660 | ;; FIXME should complain if there is nothing to continue. |
| 3650 | (defun rmail-continue () | 3661 | (defun rmail-continue () |
| @@ -3731,9 +3742,7 @@ use \\[mail-yank-original] to yank the original message into it." | |||
| 3731 | (mail-strip-quoted-names | 3742 | (mail-strip-quoted-names |
| 3732 | (if (null cc) to (concat to ", " cc)))))) | 3743 | (if (null cc) to (concat to ", " cc)))))) |
| 3733 | (if (string= cc-list "") nil cc-list))) | 3744 | (if (string= cc-list "") nil cc-list))) |
| 3734 | (if (rmail-buffers-swapped-p) | 3745 | rmail-buffer |
| 3735 | rmail-buffer | ||
| 3736 | rmail-view-buffer) | ||
| 3737 | (list (list 'rmail-mark-message | 3746 | (list (list 'rmail-mark-message |
| 3738 | rmail-buffer | 3747 | rmail-buffer |
| 3739 | (with-current-buffer rmail-buffer | 3748 | (with-current-buffer rmail-buffer |
| @@ -3835,7 +3844,7 @@ see the documentation of `rmail-resend'." | |||
| 3835 | (or (mail-fetch-field "Subject") "") | 3844 | (or (mail-fetch-field "Subject") "") |
| 3836 | "]"))) | 3845 | "]"))) |
| 3837 | (if (rmail-start-mail | 3846 | (if (rmail-start-mail |
| 3838 | nil nil subject nil nil nil | 3847 | nil nil subject nil nil rmail-buffer |
| 3839 | (list (list 'rmail-mark-message | 3848 | (list (list 'rmail-mark-message |
| 3840 | forward-buffer | 3849 | forward-buffer |
| 3841 | (with-current-buffer rmail-buffer | 3850 | (with-current-buffer rmail-buffer |
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index c4647d7893e..1ecae9faa59 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -863,7 +863,10 @@ Prefix arg means don't delete this window." | |||
| 863 | ;; even if this message was not started by an Rmail command. | 863 | ;; even if this message was not started by an Rmail command. |
| 864 | (unless return-action | 864 | (unless return-action |
| 865 | (dolist (buffer (buffer-list)) | 865 | (dolist (buffer (buffer-list)) |
| 866 | (if (eq (buffer-local-value 'major-mode buffer) 'rmail-mode) | 866 | (if (and (eq (buffer-local-value 'major-mode buffer) 'rmail-mode) |
| 867 | (null return-action) | ||
| 868 | ;; Don't match message-viewer buffer. | ||
| 869 | (not (string-match "\\` " (buffer-name buffer)))) | ||
| 867 | (setq return-action `(rmail-mail-return ,buffer))))) | 870 | (setq return-action `(rmail-mail-return ,buffer))))) |
| 868 | (if (and (null arg) return-action) | 871 | (if (and (null arg) return-action) |
| 869 | (apply (car return-action) (cdr return-action)) | 872 | (apply (car return-action) (cdr return-action)) |