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 9ADC0431FAF for ; Sat, 22 Dec 2012 12:49:13 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, 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 U2SnnVOySOKw for ; Sat, 22 Dec 2012 12:49:13 -0800 (PST) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 0CDFE431FAE for ; Sat, 22 Dec 2012 12:49:12 -0800 (PST) Received: by mail-wg0-f50.google.com with SMTP id es5so2738985wgb.5 for ; Sat, 22 Dec 2012 12:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=D73ByNkW8fS3VjhQ7r/dSid+jYji88JFyDc8P2ivp3w=; b=Ll2DhRTguQSLgRezYauBZpPhask6QvGeonigFdZ8MXL9/FvzHwU45+MbPoD+OaQ7pr zdf7N9isWqgBBdYvylq5VNdpk93OBW7c06fZb9UZQbIlwyxVP5Y4QQ2jCY1hVcKcm9iF j/71lzkMNHbc5hUVCuYBx9pycsANNGHmoE7+DskEejSgLMwcwwFgjWdg/XfW5Tc5HnF4 2L0wQ0clrujN8k4+bnldBlKNAgOBtBYm3Q61RelqvkNPP3uLORwX9vueYNn1PsH4q75V g8Is+uq9usFv88HfnSClJ6IPa+ONlruSFUe12TxR3GhtVXYr8IcaaOKDgU3zxOWYcmAT Tr5w== X-Received: by 10.194.238.226 with SMTP id vn2mr29541817wjc.23.1356209351794; Sat, 22 Dec 2012 12:49:11 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id eo10sm25090226wib.9.2012.12.22.12.49.10 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Dec 2012 12:49:11 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH] emacs: tweak error buffer handling Date: Sat, 22 Dec 2012 20:49:05 +0000 Message-Id: <1356209345-11712-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 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: Sat, 22 Dec 2012 20:49:13 -0000 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 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