From 55cc1b2979eb3597902b09b50a0d1ee3560650ec Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Tue, 25 Dec 2012 23:05:51 +0200 Subject: [PATCH] Re: [PATCH] emacs: tweak error buffer handling --- 83/9313873efdf59659e5c4bfc09e3b16c5a2a302 | 119 ++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 83/9313873efdf59659e5c4bfc09e3b16c5a2a302 diff --git a/83/9313873efdf59659e5c4bfc09e3b16c5a2a302 b/83/9313873efdf59659e5c4bfc09e3b16c5a2a302 new file mode 100644 index 000000000..d85fd3081 --- /dev/null +++ b/83/9313873efdf59659e5c4bfc09e3b16c5a2a302 @@ -0,0 +1,119 @@ +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 9E294431FB6 + for ; Tue, 25 Dec 2012 13:06:01 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 TBWLWOXjbK53 for ; + Tue, 25 Dec 2012 13:05:59 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 80CCE431FAE + for ; Tue, 25 Dec 2012 13:05:59 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 00C981000F2; + Tue, 25 Dec 2012 23:05:51 +0200 (EET) +From: Tomi Ollila +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: tweak error buffer handling +In-Reply-To: <1356209345-11712-1-git-send-email-markwalters1009@gmail.com> +References: <1356209345-11712-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.14+216~gd58661f (http://notmuchmail.org) Emacs/24.2.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +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: Tue, 25 Dec 2012 21:06:01 -0000 + +On Sat, Dec 22 2012, Mark Walters wrote: + +> view-mode-enter changed between emacs 23 and emacs 24: the current +> code makes the error buffer disappear in emacs 24 on quitting it (ie +> pressing q) but this just kills the buffer without closing the split +> window in emacs 23. +> +> This patch makes the error buffer window disappear in emacs 23 +> too. Since the view-mode-enter function changed we have to test for +> version and do the correct thing in each case. +> --- +> +> This seems to work but I have only tested on 23.4 and 24.2 + +I run emacs 23.1.1 to get the documentation of view-mode-enter +there. So, this patch instructs to delete WINDOW when exiting +view mode... + +Documentation of pop-to-buffer says: + +"Select buffer BUFFER-OR-NAME in some window, preferably a different one." + +What if pop-up-windows's value is nil -- the content of current window +is replaced with this view stuff -- and when exiting view mode, the +window will be deleted ? What happens with emacs 24 in this case ? + +Tomi + +> Best wishes +> +> Mark +> +> +> +> emacs/notmuch-lib.el | 8 +++++--- +> 1 files changed, 5 insertions(+), 3 deletions(-) +> +> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el +> index 77a591d..0407f8a 100644 +> --- a/emacs/notmuch-lib.el +> +++ b/emacs/notmuch-lib.el +> @@ -324,15 +324,17 @@ the user dismisses it." +> +> (let ((buf (get-buffer-create "*Notmuch errors*"))) +> (with-current-buffer buf +> - (view-mode-enter nil #'kill-buffer) +> + (pop-to-buffer buf) +> + (view-mode-enter (when (< emacs-major-version 24) +> + (cons (selected-window) (cons nil t))) +> + #'kill-buffer) +> (let ((inhibit-read-only t)) +> (goto-char (point-max)) +> (unless (bobp) +> (insert "\n")) +> (insert msg) +> (unless (bolp) +> - (insert "\n")))) +> - (pop-to-buffer buf))) +> + (insert "\n")))))) +> +> (defun notmuch-check-async-exit-status (proc msg) +> "If PROC exited abnormally, pop up an error buffer and signal an error. +> -- +> 1.7.9.1 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2