tweak(notmuch): bury update buffer instead of killing it
+notmuch/update would create an additional window that outlasts the update process. Instead, delete the window and bury the buffer, so that it may be read later.
This commit is contained in:
parent
b5fd085af0
commit
e48dd85e56
1 changed files with 14 additions and 12 deletions
|
@ -60,18 +60,20 @@
|
||||||
(defun +notmuch/update ()
|
(defun +notmuch/update ()
|
||||||
"Sync notmuch emails with server."
|
"Sync notmuch emails with server."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(let ((compilation-buffer-name-function (lambda (_) (format "*notmuch update*"))))
|
||||||
(with-current-buffer (compile (+notmuch-get-sync-command))
|
(with-current-buffer (compile (+notmuch-get-sync-command))
|
||||||
(add-hook
|
(add-hook
|
||||||
'compilation-finish-functions
|
'compilation-finish-functions
|
||||||
(lambda (buf status)
|
(lambda (buf status)
|
||||||
(if (equal status "finished\n")
|
(if (equal status "finished\n")
|
||||||
(progn
|
(progn
|
||||||
(kill-buffer buf)
|
(delete-windows-on buf)
|
||||||
|
(bury-buffer buf)
|
||||||
(notmuch-refresh-all-buffers)
|
(notmuch-refresh-all-buffers)
|
||||||
(message "Notmuch sync successful"))
|
(message "Notmuch sync successful"))
|
||||||
(user-error "Failed to sync notmuch data")))
|
(user-error "Failed to sync notmuch data")))
|
||||||
nil
|
nil
|
||||||
'local)))
|
'local))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +notmuch/search-delete ()
|
(defun +notmuch/search-delete ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue