changeset 106891:bcf8645ca619

Fix handling of arbitrary YANK-ACTION functions from compose-mail. * mail/sendmail.el (mail-yank-original): Set the mark if the specified function for yanking does not do it.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 17 Jan 2010 18:34:53 -0500
parents 2ed4eab78ca3
children 2bef3a4193f8
files lisp/ChangeLog lisp/mail/sendmail.el
diffstat 2 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Jan 17 18:33:55 2010 -0500
+++ b/lisp/ChangeLog	Sun Jan 17 18:34:53 2010 -0500
@@ -1,3 +1,8 @@
+2010-01-17  Chong Yidong  <cyd@stupidchicken.com>
+
+	* mail/sendmail.el (mail-yank-original): Set the mark if the
+	specified function for yanking does not do it.
+
 2010-01-17  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* vc.el (with-vc-properties): Deal with directory arguments.  (Bug#5298)
--- a/lisp/mail/sendmail.el	Sun Jan 17 18:33:55 2010 -0500
+++ b/lisp/mail/sendmail.el	Sun Jan 17 18:34:53 2010 -0500
@@ -1505,14 +1505,18 @@
   (interactive "P")
   (if mail-reply-action
       (let ((start (point))
-	    (original mail-reply-action))
+	    (original mail-reply-action)
+	    (omark (mark t)))
 	(and (consp original) (eq (car original) 'insert-buffer)
 	     (setq original (nth 1 original)))
 	(if (consp original)
-	    (apply (car original) (cdr original))
-	  ;; If the original message is in another window in the same frame,
-	  ;; delete that window to save screen space.
-	  ;; t means don't alter other frames.
+	    (progn
+	      ;; Call yank function, and set the mark if it doesn't.
+	      (apply (car original) (cdr original))
+	      (if (eq omark (mark t))
+		  (push-mark (point))))
+	  ;; If the original message is in another window in the same
+	  ;; frame, delete that window to save space.
 	  (delete-windows-on original t)
 	  (with-no-warnings
 	    ;; We really want this to set mark.