From: Lars Ingebrigtsen Date: Tue, 26 Nov 2019 01:40:59 +0000 (+0100) Subject: Fix previous message.el point-restoring fix X-Git-Tag: emacs-27.0.90~528 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5c3d0cf7910afa6b3fbdba24ac5c5817f268eb0e;p=emacs.git Fix previous message.el point-restoring fix * lisp/gnus/message.el (message-send-and-exit): Restore window point before burying buffer so we actually bury the buffer. --- diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 54ab86a970d..c66b551c1e4 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4138,17 +4138,16 @@ It should typically alter the sending method in some way or other." (actions message-exit-actions)) (when (and (message-send arg) (buffer-live-p buf)) - (message-bury buf) (if message-kill-buffer-on-exit - (kill-buffer buf)) + (kill-buffer buf) + ;; Restore the point in the message buffer. + (save-window-excursion + (switch-to-buffer buf) + (set-window-point nil position) + (set-marker position nil)) + (message-bury buf)) (message-do-actions actions) - t) - ;; Restore the point in the message buffer. - (when (buffer-live-p buf) - (save-window-excursion - (switch-to-buffer buf) - (set-window-point nil position) - (set-marker position nil))))) + t))) (defun message-dont-send () "Don't send the message you have been editing.