diff options
| author | Lars Ingebrigtsen | 2019-11-21 14:32:56 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-11-21 14:32:56 +0100 |
| commit | 37999b2eecd11536ebdad7d9527b45be93813a0a (patch) | |
| tree | 019a3970d53d1ecc62e70d881bf6b35148f42deb | |
| parent | bc4190b3f4c3b47bb2f5a955236a6d7195d8a748 (diff) | |
| download | emacs-37999b2eecd11536ebdad7d9527b45be93813a0a.tar.gz emacs-37999b2eecd11536ebdad7d9527b45be93813a0a.zip | |
Restore point after sending a message
* lisp/gnus/message.el (message-send-and-exit): Restore point
after sending (bug#38303).
| -rw-r--r-- | lisp/gnus/message.el | 9 |
1 files changed, 8 insertions, 1 deletions
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. | |||
| 4123 | It should typically alter the sending method in some way or other." | 4123 | It should typically alter the sending method in some way or other." |
| 4124 | (interactive "P") | 4124 | (interactive "P") |
| 4125 | (let ((buf (current-buffer)) | 4125 | (let ((buf (current-buffer)) |
| 4126 | (position (point-marker)) | ||
| 4126 | (actions message-exit-actions)) | 4127 | (actions message-exit-actions)) |
| 4127 | (when (and (message-send arg) | 4128 | (when (and (message-send arg) |
| 4128 | (buffer-live-p buf)) | 4129 | (buffer-live-p buf)) |
| @@ -4130,7 +4131,13 @@ It should typically alter the sending method in some way or other." | |||
| 4130 | (if message-kill-buffer-on-exit | 4131 | (if message-kill-buffer-on-exit |
| 4131 | (kill-buffer buf)) | 4132 | (kill-buffer buf)) |
| 4132 | (message-do-actions actions) | 4133 | (message-do-actions actions) |
| 4133 | t))) | 4134 | t) |
| 4135 | ;; Restore the point in the message buffer. | ||
| 4136 | (when (buffer-live-p buf) | ||
| 4137 | (save-window-excursion | ||
| 4138 | (switch-to-buffer buf) | ||
| 4139 | (set-window-point nil position) | ||
| 4140 | (set-marker position nil))))) | ||
| 4134 | 4141 | ||
| 4135 | (defun message-dont-send () | 4142 | (defun message-dont-send () |
| 4136 | "Don't send the message you have been editing. | 4143 | "Don't send the message you have been editing. |