diff options
| author | Richard M. Stallman | 2012-04-17 19:23:20 -0400 |
|---|---|---|
| committer | Richard M. Stallman | 2012-04-17 19:23:20 -0400 |
| commit | 5f6530ea79767d596c1950a94d63415475e5b1df (patch) | |
| tree | bc57c93f9ee886812a5e6768f5a6b0b771700733 | |
| parent | aba027e80c6d2776d7ec35747308367351871e98 (diff) | |
| download | emacs-5f6530ea79767d596c1950a94d63415475e5b1df.tar.gz emacs-5f6530ea79767d596c1950a94d63415475e5b1df.zip | |
Fix logic for returning to and yanking from Rmail buffer.
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/mail/rmail.el | 23 | ||||
| -rw-r--r-- | lisp/mail/sendmail.el | 7 |
3 files changed, 35 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d9aadbe0f22..75b1c7799c4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2012-04-17 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * mail/rmail.el (rmail-start-mail): | ||
| 4 | Pass (rmail-mail-return...) for the return-action. | ||
| 5 | Pass (rmail-yank-current-message...) for the yank-action. | ||
| 6 | (rmail-yank-current-message): New function. | ||
| 7 | (rmail-mail): Pass the Rmail buffer, not view buffer, for replybuffer. | ||
| 8 | (rmail-reply): Likewise. | ||
| 9 | (rmail-forward): Pass the Rmail buffer, not nil, for replybuffer. | ||
| 10 | |||
| 11 | * mail/sendmail.el (mail-bury): Choose the first rmail-mode | ||
| 12 | buffer, not the last. Reject temp buffers. Use the rmail-mode | ||
| 13 | buffer, not newbuf. | ||
| 14 | |||
| 1 | 2012-04-17 Juanma Barranquero <lekktu@gmail.com> | 15 | 2012-04-17 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 16 | ||
| 3 | * server.el (server-ensure-safe-dir): Simplify. | 17 | * server.el (server-ensure-safe-dir): Simplify. |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 093050229c4..12d1e0c6c36 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 f8958a691b2..0b0f2795610 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -863,8 +863,11 @@ 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 | (setq return-action `(rmail-mail-return ,newbuf))))) | 867 | (null return-action) |
| 868 | ;; Don't match message-viewer buffer. | ||
| 869 | (not (string-match "\\` " (buffer-name 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)) |
| 870 | (switch-to-buffer newbuf)))) | 873 | (switch-to-buffer newbuf)))) |