# HG changeset patch # User Juanma Barranquero # Date 1263789876 -3600 # Node ID 86d456f300a864ffbe75be1f43a69bf431d52103 # Parent fb36a68f9d4871b84f00b5e957cc38f4b5c1f497# Parent 181539c8b6a449f08208b356d435d864b62074cf Fix typos. diff -r 181539c8b6a4 -r 86d456f300a8 lisp/ChangeLog --- a/lisp/ChangeLog Mon Jan 18 05:39:40 2010 +0100 +++ b/lisp/ChangeLog Mon Jan 18 05:44:36 2010 +0100 @@ -78,6 +78,11 @@ * term/x-win.el (emacs-session-save, x-menu-bar-open, icon-map-list): Fix typos in docstrings. +2010-01-17 Chong Yidong + + * mail/sendmail.el (mail-yank-original): Set the mark if the + specified function for yanking does not do it. + 2010-01-17 Dan Nicolaescu * vc.el (with-vc-properties): Deal with directory arguments. (Bug#5298) @@ -171,7 +176,7 @@ 2010-01-15 Kenichi Handa * international/mule-cmds.el (canonicalize-coding-system-name): - Convert "msXXX", "ibmXXX", "windows-XXX" to "cpXXX". + Convert "msXXX", "ibmXXX", "windows-XXX" to "cpXXX" (Bug#5387). 2010-01-15 Glenn Morris diff -r 181539c8b6a4 -r 86d456f300a8 lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Mon Jan 18 05:39:40 2010 +0100 +++ b/lisp/gnus/ChangeLog Mon Jan 18 05:44:36 2010 +0100 @@ -1,3 +1,12 @@ +2010-01-17 Chong Yidong + + * message.el (message-mail): Just pass yank-action on to message-setup. + (message-setup): Handle (FUN . ARGS) form of yank-action. + (message-with-reply-buffer, message-widen-reply) + (message-yank-original): Handle non-buffer values of + message-reply-buffer (Bug#4080). + (message-setup-1): Prefer to save message-reply-buffer as a buffer. + 2010-01-17 Juanma Barranquero * nnmairix.el (nnmairix-group-delete-recreate-this-group): diff -r 181539c8b6a4 -r 86d456f300a8 lisp/gnus/message.el --- a/lisp/gnus/message.el Mon Jan 18 05:39:40 2010 +0100 +++ b/lisp/gnus/message.el Mon Jan 18 05:44:36 2010 +0100 @@ -1139,6 +1139,8 @@ (string :tag "name") (sexp :tag "none" :format "%t" t))) +;; This can be the name of a buffer, or a cons cell (FUNCTION . ARGS) +;; for yanking the original buffer. (defvar message-reply-buffer nil) (defvar message-reply-headers nil "The headers of the current replied article. @@ -1997,7 +1999,7 @@ (defmacro message-with-reply-buffer (&rest forms) "Evaluate FORMS in the reply buffer, if it exists." - `(when (and message-reply-buffer + `(when (and (bufferp message-reply-buffer) (buffer-name message-reply-buffer)) (with-current-buffer message-reply-buffer ,@forms))) @@ -3179,7 +3181,7 @@ "Widen the reply to include maximum recipients." (interactive) (let ((follow-to - (and message-reply-buffer + (and (bufferp message-reply-buffer) (buffer-name message-reply-buffer) (with-current-buffer message-reply-buffer (message-get-reply-headers t))))) @@ -3674,9 +3676,16 @@ (point-max))) (delete-region (message-goto-body) (point-max))) (set (make-local-variable 'message-cite-reply-above) nil))) - (delete-windows-on message-reply-buffer t) + (if (bufferp message-reply-buffer) + (delete-windows-on message-reply-buffer t)) (push-mark (save-excursion - (insert-buffer-substring message-reply-buffer) + (cond + ((bufferp message-reply-buffer) + (insert-buffer-substring message-reply-buffer)) + ((and (consp message-reply-buffer) + (functionp (car message-reply-buffer))) + (apply (car message-reply-buffer) + (cdr message-reply-buffer)))) (unless (bolp) (insert ?\n)) (point))) @@ -6251,14 +6260,14 @@ nil mua))) -(defun message-setup (headers &optional replybuffer actions +;; YANK-ACTION, if non-nil, can be a buffer or a yank action of the +;; form (FUNCTION . ARGS). +(defun message-setup (headers &optional yank-action actions continue switch-function) (let ((mua (message-mail-user-agent)) - subject to field yank-action) + subject to field) (if (not (and message-this-is-mail mua)) - (message-setup-1 headers replybuffer actions) - (if replybuffer - (setq yank-action (list 'insert-buffer replybuffer))) + (message-setup-1 headers yank-action actions) (setq headers (copy-sequence headers)) (setq field (assq 'Subject headers)) (when field @@ -6275,7 +6284,11 @@ (format "%s" (car item)) (cdr item))) headers) - continue switch-function yank-action actions))))) + continue switch-function + (if (bufferp yank-action) + (list 'insert-buffer yank-action) + yank-action) + actions))))) (defun message-headers-to-generate (headers included-headers excluded-headers) "Return a list that includes all headers from HEADERS. @@ -6302,12 +6315,16 @@ (push header result))) (nreverse result))) -(defun message-setup-1 (headers &optional replybuffer actions) +(defun message-setup-1 (headers &optional yank-action actions) (dolist (action actions) (condition-case nil (add-to-list 'message-send-actions `(apply ',(car action) ',(cdr action))))) - (setq message-reply-buffer replybuffer) + (setq message-reply-buffer + (if (and (consp yank-action) + (eq (car yank-action) 'insert-buffer)) + (nth 1 yank-action) + yank-action)) (goto-char (point-min)) ;; Insert all the headers. (mail-header-format @@ -6438,7 +6455,7 @@ to continue editing a message already being composed. SWITCH-FUNCTION is a function used to switch to and display the mail buffer." (interactive) - (let ((message-this-is-mail t) replybuffer) + (let ((message-this-is-mail t)) (unless (message-mail-user-agent) (message-pop-to-buffer ;; Search for the existing message buffer if `continue' is non-nil. @@ -6449,15 +6466,11 @@ message-generate-new-buffers))) (message-buffer-name "mail" to)) switch-function)) - ;; FIXME: message-mail should do something if YANK-ACTION is not - ;; insert-buffer. - (and (consp yank-action) (eq (car yank-action) 'insert-buffer) - (setq replybuffer (nth 1 yank-action))) (message-setup (nconc `((To . ,(or to "")) (Subject . ,(or subject ""))) (when other-headers other-headers)) - replybuffer send-actions continue switch-function) + yank-action send-actions continue switch-function) ;; FIXME: Should return nil if failure. t)) diff -r 181539c8b6a4 -r 86d456f300a8 lisp/mail/sendmail.el --- a/lisp/mail/sendmail.el Mon Jan 18 05:39:40 2010 +0100 +++ b/lisp/mail/sendmail.el Mon Jan 18 05:44:36 2010 +0100 @@ -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.