emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 37999b2: Restore point after sending a message


From: Lars Ingebrigtsen
Subject: master 37999b2: Restore point after sending a message
Date: Thu, 21 Nov 2019 08:33:04 -0500 (EST)

branch: master
commit 37999b2eecd11536ebdad7d9527b45be93813a0a
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    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 9de35bd..83ec211 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]