[PATCH] emacs: tweak error buffer handling
authorMark Walters <markwalters1009@gmail.com>
Sat, 22 Dec 2012 20:49:05 +0000 (20:49 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:52:37 +0000 (09:52 -0800)
80/88c5d294018bc0214c6f0be62f787e4dfa8e87 [new file with mode: 0644]

diff --git a/80/88c5d294018bc0214c6f0be62f787e4dfa8e87 b/80/88c5d294018bc0214c6f0be62f787e4dfa8e87
new file mode 100644 (file)
index 0000000..eee0b40
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <markwalters1009@gmail.com>\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 9ADC0431FAF\r
+       for <notmuch@notmuchmail.org>; Sat, 22 Dec 2012 12:49:13 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       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 U2SnnVOySOKw for <notmuch@notmuchmail.org>;\r
+       Sat, 22 Dec 2012 12:49:13 -0800 (PST)\r
+Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com\r
+ [74.125.82.50])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 0CDFE431FAE   for <notmuch@notmuchmail.org>; Sat, 22 Dec 2012 12:49:12 -0800\r
+ (PST)\r
+Received: by mail-wg0-f50.google.com with SMTP id es5so2738985wgb.5\r
+       for <notmuch@notmuchmail.org>; Sat, 22 Dec 2012 12:49:11 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=x-received:from:to:cc:subject:date:message-id:x-mailer;\r
+       bh=D73ByNkW8fS3VjhQ7r/dSid+jYji88JFyDc8P2ivp3w=;\r
+       b=Ll2DhRTguQSLgRezYauBZpPhask6QvGeonigFdZ8MXL9/FvzHwU45+MbPoD+OaQ7pr\r
+       zdf7N9isWqgBBdYvylq5VNdpk93OBW7c06fZb9UZQbIlwyxVP5Y4QQ2jCY1hVcKcm9iF\r
+       j/71lzkMNHbc5hUVCuYBx9pycsANNGHmoE7+DskEejSgLMwcwwFgjWdg/XfW5Tc5HnF4\r
+       2L0wQ0clrujN8k4+bnldBlKNAgOBtBYm3Q61RelqvkNPP3uLORwX9vueYNn1PsH4q75V\r
+       g8Is+uq9usFv88HfnSClJ6IPa+ONlruSFUe12TxR3GhtVXYr8IcaaOKDgU3zxOWYcmAT\r
+       Tr5w==\r
+X-Received: by 10.194.238.226 with SMTP id vn2mr29541817wjc.23.1356209351794; \r
+       Sat, 22 Dec 2012 12:49:11 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id eo10sm25090226wib.9.2012.12.22.12.49.10\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 22 Dec 2012 12:49:11 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: tweak error buffer handling\r
+Date: Sat, 22 Dec 2012 20:49:05 +0000\r
+Message-Id: <1356209345-11712-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\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: Sat, 22 Dec 2012 20:49:13 -0000\r
+\r
+view-mode-enter changed between emacs 23 and emacs 24: the current\r
+code makes the error buffer disappear in emacs 24 on quitting it (ie\r
+pressing q) but this just kills the buffer without closing the split\r
+window in emacs 23.\r
+\r
+This patch makes the error buffer window disappear in emacs 23\r
+too. Since the view-mode-enter function changed we have to test for\r
+version and do the correct thing in each case.\r
+---\r
+\r
+This seems to work but I have only tested on 23.4 and 24.2\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+ emacs/notmuch-lib.el |    8 +++++---\r
+ 1 files changed, 5 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 77a591d..0407f8a 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -324,15 +324,17 @@ the user dismisses it."\r
\r
+   (let ((buf (get-buffer-create "*Notmuch errors*")))\r
+     (with-current-buffer buf\r
+-      (view-mode-enter nil #'kill-buffer)\r
++      (pop-to-buffer buf)\r
++      (view-mode-enter (when (< emacs-major-version 24)\r
++                         (cons (selected-window) (cons nil t)))\r
++                     #'kill-buffer)\r
+       (let ((inhibit-read-only t))\r
+       (goto-char (point-max))\r
+       (unless (bobp)\r
+         (insert "\n"))\r
+       (insert msg)\r
+       (unless (bolp)\r
+-        (insert "\n"))))\r
+-    (pop-to-buffer buf)))\r
++        (insert "\n"))))))\r
\r
+ (defun notmuch-check-async-exit-status (proc msg)\r
+   "If PROC exited abnormally, pop up an error buffer and signal an error.\r
+-- \r
+1.7.9.1\r
+\r