emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107957: Fix logic for returning t


From: Richard Stallman
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107957: Fix logic for returning to and yanking from Rmail buffer.
Date: Fri, 02 Nov 2012 01:46:08 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 107957
committer: Richard Stallman <address@hidden>
branch nick: trunk
timestamp: Tue 2012-04-17 19:23:20 -0400
message:
  Fix logic for returning to and yanking from Rmail buffer.
modified:
  lisp/ChangeLog
  lisp/mail/rmail.el
  lisp/mail/sendmail.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-17 17:05:22 +0000
+++ b/lisp/ChangeLog    2012-04-17 23:23:20 +0000
@@ -1,3 +1,17 @@
+2012-04-17  Richard Stallman  <address@hidden>
+
+       * 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.
+
 2012-04-17  Juanma Barranquero  <address@hidden>
 
        * server.el (server-ensure-safe-dir): Simplify.

=== modified file 'lisp/mail/rmail.el'
--- a/lisp/mail/rmail.el        2012-04-09 13:05:48 +0000
+++ b/lisp/mail/rmail.el        2012-04-17 23:23:20 +0000
@@ -3560,6 +3560,16 @@
 
 ;;;; *** Rmail Mailing Commands ***
 
+(defun rmail-yank-current-message (buffer)
+  "Yank into the current buffer the current message of Rmail buffer BUFFER.
+If BUFFER is swapped with its message viewer buffer, yank out of BUFFER.
+If BUFFER is not swapped, yank out of its message viewer buffer."
+  (with-current-buffer buffer
+    (unless (rmail-buffers-swapped-p)
+      (setq buffer rmail-view-buffer)))
+  (insert-buffer buffer))
+
+
 (defun rmail-start-mail (&optional noerase to subject in-reply-to cc
                                   replybuffer sendactions same-window
                                   other-headers)
@@ -3571,7 +3581,8 @@
     (if replybuffer
        ;; The function used here must behave like insert-buffer wrt
        ;; point and mark (see doc of sc-cite-original).
-       (setq yank-action (list 'insert-buffer replybuffer)))
+       (setq yank-action
+             `(rmail-yank-current-message ,replybuffer)))
     (push (cons "cc" cc) other-headers)
     (push (cons "in-reply-to" in-reply-to) other-headers)
     (setq other-headers
@@ -3587,7 +3598,7 @@
     (prog1
        (compose-mail to subject other-headers noerase
                      switch-function yank-action sendactions
-                     `(rmail-mail-return ,replybuffer))
+                     (if replybuffer `(rmail-mail-return ,replybuffer)))
       (if (eq switch-function 'switch-to-buffer-other-frame)
          ;; This is not a standard frame parameter; nothing except
          ;; sendmail.el looks at it.
@@ -3644,7 +3655,7 @@
 While composing the message, use \\[mail-yank-original] to yank the
 original message into it."
   (interactive)
-  (rmail-start-mail nil nil nil nil nil rmail-view-buffer))
+  (rmail-start-mail nil nil nil nil nil rmail-buffer))
 
 ;; FIXME should complain if there is nothing to continue.
 (defun rmail-continue ()
@@ -3731,9 +3742,7 @@
                        (mail-strip-quoted-names
                         (if (null cc) to (concat to ", " cc))))))
         (if (string= cc-list "") nil cc-list)))
-     (if (rmail-buffers-swapped-p)
-        rmail-buffer
-       rmail-view-buffer)
+     rmail-buffer
      (list (list 'rmail-mark-message
                 rmail-buffer
                 (with-current-buffer rmail-buffer
@@ -3835,7 +3844,7 @@
                           (or (mail-fetch-field "Subject") "")
                           "]")))
       (if (rmail-start-mail
-          nil nil subject nil nil nil
+          nil nil subject nil nil rmail-buffer
           (list (list 'rmail-mark-message
                       forward-buffer
                       (with-current-buffer rmail-buffer

=== modified file 'lisp/mail/sendmail.el'
--- a/lisp/mail/sendmail.el     2012-04-09 13:05:48 +0000
+++ b/lisp/mail/sendmail.el     2012-04-17 23:23:20 +0000
@@ -863,8 +863,11 @@
     ;; even if this message was not started by an Rmail command.
     (unless return-action
       (dolist (buffer (buffer-list))
-       (if (eq (buffer-local-value 'major-mode buffer) 'rmail-mode)
-           (setq return-action `(rmail-mail-return ,newbuf)))))
+       (if (and (eq (buffer-local-value 'major-mode buffer) 'rmail-mode)
+                (null return-action)
+                ;; Don't match message-viewer buffer.
+                (not (string-match "\\` " (buffer-name buffer))))
+           (setq return-action `(rmail-mail-return ,buffer)))))
     (if (and (null arg) return-action)
        (apply (car return-action) (cdr return-action))
       (switch-to-buffer newbuf))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]