X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=fd25f7c9e6279b528c81b1908948ff7554a12015;hb=30f1c43efe32c83193a6b9ae1f31ab2667e4195d;hp=1e166c6afce53a501689c616f6478d7d3d496412;hpb=0f35ddcdfc9d4011db32def6082f8aec5c372a7b;p=notmuch diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 1e166c6a..fd25f7c9 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -135,7 +135,7 @@ For example, if you wanted to remove an \"inbox\" tag and add an (defvar notmuch-common-keymap (let ((map (make-sparse-keymap))) (define-key map "?" 'notmuch-help) - (define-key map "q" 'notmuch-kill-this-buffer) + (define-key map "q" 'notmuch-bury-or-kill-this-buffer) (define-key map "s" 'notmuch-search) (define-key map "z" 'notmuch-tree) (define-key map "m" 'notmuch-mua-new-mail) @@ -239,10 +239,15 @@ depending on the value of `notmuch-poll-script'." (call-process notmuch-poll-script nil nil)) (call-process notmuch-command nil nil nil "new"))) -(defun notmuch-kill-this-buffer () - "Kill the current buffer." +(defun notmuch-bury-or-kill-this-buffer () + "Undisplay the current buffer. + +Bury the current buffer, unless there is only one window showing +it, in which case it is killed." (interactive) - (kill-buffer (current-buffer))) + (if (> (length (get-buffer-window-list nil nil t)) 1) + (bury-buffer) + (kill-buffer))) (defun notmuch-documentation-first-line (symbol) "Return the first line of the documentation string for SYMBOL."