mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
emacs: Add `notmuch-jump-to-recent-buffer'.
From a Carl Worth idea: add a function which will select the most recently used notmuch buffer (search, show or hello). If no recent buffer is found, run `notmuch'. It is expected that the user will global bind this command to a key sequence.
This commit is contained in:
parent
59adb2da19
commit
4a2a271878
1 changed files with 17 additions and 0 deletions
|
@ -1055,6 +1055,23 @@ current search results AND that are tagged with the given tag."
|
|||
(interactive)
|
||||
(notmuch-hello))
|
||||
|
||||
;;;###autoload
|
||||
(defun notmuch-jump-to-recent-buffer ()
|
||||
"Jump to the most recent notmuch buffer (search, show or hello).
|
||||
|
||||
If no recent buffer is found, run `notmuch'."
|
||||
(interactive)
|
||||
(let ((last
|
||||
(loop for buffer in (buffer-list)
|
||||
if (with-current-buffer buffer
|
||||
(memq major-mode '(notmuch-show-mode
|
||||
notmuch-search-mode
|
||||
notmuch-hello-mode)))
|
||||
return buffer)))
|
||||
(if last
|
||||
(switch-to-buffer last)
|
||||
(notmuch))))
|
||||
|
||||
(setq mail-user-agent 'notmuch-user-agent)
|
||||
|
||||
(provide 'notmuch)
|
||||
|
|
Loading…
Reference in a new issue