--- /dev/null
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id D1D61431FB6\r
+ for <notmuch@notmuchmail.org>; Thu, 16 Oct 2014 05:03:53 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Cf+Hd2+pEkiJ for <notmuch@notmuchmail.org>;\r
+ Thu, 16 Oct 2014 05:03:49 -0700 (PDT)\r
+Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com\r
+ [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id E5DEB431FAF\r
+ for <notmuch@notmuchmail.org>; Thu, 16 Oct 2014 05:03:48 -0700 (PDT)\r
+Received: by mail-wi0-f178.google.com with SMTP id h11so4950258wiw.17\r
+ for <notmuch@notmuchmail.org>; Thu, 16 Oct 2014 05:03:47 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:to:subject:date:user-agent:from:message-id\r
+ :mime-version:content-type;\r
+ bh=CryQh99xYZdrOEeqv5s597aq6310PlFMMDXkvguv+Is=;\r
+ b=KbA6d6TP0OIVjAzbb7FQ2hp1gBwCCeZTQ2kzi6ms3bSmDItnPlKJxOCRxvWlPHVDxr\r
+ szpZO/rkkGs6Rai3VHmRIE0Bxre0jVAOKfJJesKEb70xa1gElrkUMdGuh2QuLgcSDflD\r
+ c77E+kBUGbneN880OXWS8vn9SoG73UMbUn0SX9xVnAUrKZ+D+aHrCR2AqhZ5IdtzdwwZ\r
+ KEz0NKx+AW1oyHW9S1i80Qe2oGTaYIOzkKiG6gBUsRONcjxHYe0UNoXchMEhLVf85W0a\r
+ rTLVIAUvjd2c+Ci23H0iMZoR/mr6L4S1ES7Kra/AUhPq/QRW7huE3wB3PJ/K9z9XP83W\r
+ g1mg==\r
+X-Gm-Message-State:\r
+ ALoCoQkAUFrsS6GDCuIBxtWbWHb60Y0LkzAKO8HW8tpE3ba454Qvw7SknK33xVlUvBqbqbTBEt0f\r
+X-Received: by 10.180.74.4 with SMTP id p4mr5400374wiv.20.1413461027195;\r
+ Thu, 16 Oct 2014 05:03:47 -0700 (PDT)\r
+Received: from localhost ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
+ by mx.google.com with ESMTPSA id ji10sm1767780wid.7.2014.10.16.05.03.45\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Thu, 16 Oct 2014 05:03:46 -0700 (PDT)\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC][PATCH v1] emacs: Improve the behaviour of the 'q' binding.\r
+Date: Thu, 16 Oct 2014 12:59:40 +0100\r
+User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+From: David Edmondson <dme@dme.org>\r
+Message-ID: <cunmw8wql0f.fsf@gargravarr.hh.sledj.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 16 Oct 2014 12:03:54 -0000\r
+\r
+When a user hits 'q' in a notmuch buffer, kill the buffer only if\r
+there are no other windows currently showing it.\r
+---\r
+\r
+This arose from a discussion in #notmuch. Please try it and see if you\r
+like the new behaviour.\r
+\r
+ emacs/notmuch-lib.el | 8 ++++++--\r
+ 1 file changed, 6 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 1e166c6..bc6f119 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -240,9 +240,13 @@ depending on the value of `notmuch-poll-script'."\r
+ (call-process notmuch-command nil nil nil "new")))\r
+ \r
+ (defun notmuch-kill-this-buffer ()\r
+- "Kill the current buffer."\r
++ "Undisplay the current buffer."\r
+ (interactive)\r
+- (kill-buffer (current-buffer)))\r
++ ;; If more than one window is showing this buffer, bury rather than\r
++ ;; kill it.\r
++ (if (> (length (get-buffer-window-list nil nil t)) 1)\r
++ (bury-buffer)\r
++ (kill-buffer)))\r
+ \r
+ (defun notmuch-documentation-first-line (symbol)\r
+ "Return the first line of the documentation string for SYMBOL."\r
+-- \r
+2.1.1\r
+\r