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 DDECE431FB6 for ; Wed, 26 Dec 2012 14:27:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 nY-sJM5nIRYA for ; Wed, 26 Dec 2012 14:27:46 -0800 (PST) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 0F962431FAF for ; Wed, 26 Dec 2012 14:27:46 -0800 (PST) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1TnzRq-0001eV-Dy; Wed, 26 Dec 2012 22:27:40 +0000 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1TnzRq-0001CD-07; Wed, 26 Dec 2012 22:27:38 +0000 From: Mark Walters To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: tweak error buffer handling In-Reply-To: References: <1356209345-11712-1-git-send-email-markwalters1009@gmail.com> User-Agent: Notmuch/0.14+236~g1d0044f (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Wed, 26 Dec 2012 22:27:39 +0000 Message-ID: <87k3s4fnz8.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 8769129b494359b372bba34d34ecb1ad (of first 20000 bytes) X-SpamAssassin-Score: -1.8 X-SpamAssassin-SpamBar: - X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -1.8 points. Summary of the scoring: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [138.37.6.40 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay * domain * 0.5 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean 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: Wed, 26 Dec 2012 22:27:47 -0000 On Tue, 25 Dec 2012, Tomi Ollila wrote: > 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 ? Hi You are quite right there are problems here under emacs 23: if you already have a split window when the error occurs in one part the error is displayed in the other window and then on exit that (previously existing) window is closed. What do people think should happen on an error? I, personally, don't like taking over an existing window, and Jamie liked some of the errors (eg non-fatal `locked database' tagging errors) to be shown in the mini-buffer. I also think it is going to be difficult to get this right: emacs 23 and 24 are different and there are also some user configuration variable that affect what happens. Best wishes Mark > > 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