[RFC][PATCH v1] emacs: Improve the behaviour of the 'q' binding.
Jani Nikula
jani at nikula.org
Tue Oct 28 10:08:53 PDT 2014
On Thu, 16 Oct 2014, David Edmondson <dme at dme.org> wrote:
> When a user hits 'q' in a notmuch buffer, kill the buffer only if
> there are no other windows currently showing it.
> ---
>
> This arose from a discussion in #notmuch. Please try it and see if you
> like the new behaviour.
Yes, very much, thank you. In most cases I want 'q' to only affect the
current window. I like to be able to 'C-x 2' a search view, and have the
two windows work more or less independently.
BR,
Jani.
>
> emacs/notmuch-lib.el | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index 1e166c6..bc6f119 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -240,9 +240,13 @@ depending on the value of `notmuch-poll-script'."
> (call-process notmuch-command nil nil nil "new")))
>
> (defun notmuch-kill-this-buffer ()
> - "Kill the current buffer."
> + "Undisplay the current buffer."
> (interactive)
> - (kill-buffer (current-buffer)))
> + ;; If more than one window is showing this buffer, bury rather than
> + ;; kill it.
> + (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."
> --
> 2.1.1
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
More information about the notmuch
mailing list