]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix previous message.el point-restoring fix
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 26 Nov 2019 01:40:59 +0000 (02:40 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 26 Nov 2019 01:40:59 +0000 (02:40 +0100)
* lisp/gnus/message.el (message-send-and-exit): Restore window
point before burying buffer so we actually bury the buffer.

lisp/gnus/message.el

index 54ab86a970dcdb65ed28cd72883c033344679811..c66b551c1e4516328dc31196e4b69968b5bf7b9f 100644 (file)
@@ -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.