diff options
| author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-03-13 16:12:54 +0100 |
|---|---|---|
| committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-03-13 16:12:54 +0100 |
| commit | 92d5ed112bbaffaaf9948643b5b692a2bbf16a54 (patch) | |
| tree | 0da8158a7f7ec9dec6d8e7b32eda86746c9b7238 /mu4e | |
| parent | e3274461dbb80e20acf226c5df4efba1c8a9ce82 (diff) | |
* mu4e/mu4e-main.el (mu4e~main-toggle-mail-sending-mode): Save position when toggling.
Diffstat (limited to 'mu4e')
| -rw-r--r-- | mu4e/mu4e-main.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/mu4e/mu4e-main.el b/mu4e/mu4e-main.el index 1151d6e..1f608b7 100644 --- a/mu4e/mu4e-main.el +++ b/mu4e/mu4e-main.el @@ -158,12 +158,15 @@ clicked." (defun mu4e~main-toggle-mail-sending-mode () "Toggle sending mail mode, either queued or direct." (interactive) - (unless (file-directory-p smtpmail-queue-dir) - (mu4e-error "`smtpmail-queue-dir' does not exist")) - (setq smtpmail-queue-mail (not smtpmail-queue-mail)) - (message - (concat "Outgoing mail will now be " - (if smtpmail-queue-mail "queued" "sent directly"))) - (mu4e~main-view)) + (let ((curpos (point))) + (unless (file-directory-p smtpmail-queue-dir) + (mu4e-error "`smtpmail-queue-dir' does not exist")) + (setq smtpmail-queue-mail (not smtpmail-queue-mail)) + (message + (concat "Outgoing mail will now be " + (if smtpmail-queue-mail "queued" "sent directly"))) + (mu4e~main-view) + ;; "queued" and "direct" have same length. + (goto-char curpos))) (provide 'mu4e-main) |
