Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D1D61431FB6 for ; Thu, 16 Oct 2014 05:03:53 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Cf+Hd2+pEkiJ for ; Thu, 16 Oct 2014 05:03:49 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E5DEB431FAF for ; Thu, 16 Oct 2014 05:03:48 -0700 (PDT) Received: by mail-wi0-f178.google.com with SMTP id h11so4950258wiw.17 for ; Thu, 16 Oct 2014 05:03:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:date:user-agent:from:message-id :mime-version:content-type; bh=CryQh99xYZdrOEeqv5s597aq6310PlFMMDXkvguv+Is=; b=KbA6d6TP0OIVjAzbb7FQ2hp1gBwCCeZTQ2kzi6ms3bSmDItnPlKJxOCRxvWlPHVDxr szpZO/rkkGs6Rai3VHmRIE0Bxre0jVAOKfJJesKEb70xa1gElrkUMdGuh2QuLgcSDflD c77E+kBUGbneN880OXWS8vn9SoG73UMbUn0SX9xVnAUrKZ+D+aHrCR2AqhZ5IdtzdwwZ KEz0NKx+AW1oyHW9S1i80Qe2oGTaYIOzkKiG6gBUsRONcjxHYe0UNoXchMEhLVf85W0a rTLVIAUvjd2c+Ci23H0iMZoR/mr6L4S1ES7Kra/AUhPq/QRW7huE3wB3PJ/K9z9XP83W g1mg== X-Gm-Message-State: ALoCoQkAUFrsS6GDCuIBxtWbWHb60Y0LkzAKO8HW8tpE3ba454Qvw7SknK33xVlUvBqbqbTBEt0f X-Received: by 10.180.74.4 with SMTP id p4mr5400374wiv.20.1413461027195; Thu, 16 Oct 2014 05:03:47 -0700 (PDT) Received: from localhost ([2a01:348:1a2:1:ea39:35ff:fe2c:a227]) by mx.google.com with ESMTPSA id ji10sm1767780wid.7.2014.10.16.05.03.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Oct 2014 05:03:46 -0700 (PDT) To: notmuch@notmuchmail.org Subject: [RFC][PATCH v1] emacs: Improve the behaviour of the 'q' binding. Date: Thu, 16 Oct 2014 12:59:40 +0100 User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) From: David Edmondson Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 12:03:54 -0000 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. 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