X-Git-Url: https://rtime.felk.cvut.cz/gitweb/notmuch.git/blobdiff_plain/0f35ddcdfc9d4011db32def6082f8aec5c372a7b..30f1c43efe32c83193a6b9ae1f31ab2667e4195d:/emacs/notmuch-lib.el 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."