From 37999b2eecd11536ebdad7d9527b45be93813a0a Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 21 Nov 2019 14:32:56 +0100 Subject: [PATCH] Restore point after sending a message * lisp/gnus/message.el (message-send-and-exit): Restore point after sending (bug#38303). --- lisp/gnus/message.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 9de35bd44c0..83ec211a7d1 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4123,6 +4123,7 @@ The usage of ARG is defined by the instance that called Message. It should typically alter the sending method in some way or other." (interactive "P") (let ((buf (current-buffer)) + (position (point-marker)) (actions message-exit-actions)) (when (and (message-send arg) (buffer-live-p buf)) @@ -4130,7 +4131,13 @@ It should typically alter the sending method in some way or other." (if message-kill-buffer-on-exit (kill-buffer buf)) (message-do-actions actions) - t))) + 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))))) (defun message-dont-send () "Don't send the message you have been editing. -- 2.39.2