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 C417A4196F2 for ; Sat, 6 Nov 2010 14:35:24 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -4.2 X-Spam-Level: X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham 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 zx9eKbFcR5yW for ; Sat, 6 Nov 2010 14:35:12 -0700 (PDT) Received: from brinza.cc.columbia.edu (brinza.cc.columbia.edu [128.59.29.8]) by olra.theworths.org (Postfix) with ESMTP id AFF524196F0 for ; Sat, 6 Nov 2010 14:35:12 -0700 (PDT) Received: from servo.finestructure.net (cpe-74-66-82-137.nyc.res.rr.com [74.66.82.137]) (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0) by brinza.cc.columbia.edu (8.14.4/8.14.3) with ESMTP id oA6LZAw6007517 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT) for ; Sat, 6 Nov 2010 17:35:11 -0400 (EDT) Received: from jrollins by servo.finestructure.net with local (Exim 4.72) (envelope-from ) id 1PEqPk-0001rR-Tn for notmuch@notmuchmail.org; Sat, 06 Nov 2010 17:35:08 -0400 From: Jameson Rollins To: Notmuch Mail Subject: [PATCH 1/2] Don't use kill-this-buffer to kill notmuch emacs buffers Date: Sat, 6 Nov 2010 16:49:28 -0400 Message-ID: <87y696yw37.fsf@servo.finestructure.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.68 on 128.59.29.8 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, 06 Nov 2010 21:35:24 -0000 kill-this-buffer appears to be a function intended specifically for use in the menu bar, and causes problem killing notmuch buffers when multiple frames have been used. This patch replaces kill-this-buffer with notmuch-kill-this-buffer, which in turn just simply calls (kill-buffer (current-buffer)). --- emacs/notmuch-hello.el | 2 +- emacs/notmuch-lib.el | 5 +++++ emacs/notmuch-show.el | 4 ++-- emacs/notmuch.el | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 4b6a90d..e58dd24 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -294,7 +294,7 @@ should be. Returns a cons cell `(tags-per-line width)'." (define-key map "v" '(lambda () "Display the notmuch version" (interactive) (message "notmuch version %s" (notmuch-version)))) (define-key map "?" 'notmuch-help) - (define-key map "q" 'kill-this-buffer) + (define-key map "q" 'notmuch-kill-this-buffer) (define-key map "=" 'notmuch-hello-update) (define-key map "G" 'notmuch-hello-poll-and-update) (define-key map (kbd "") 'widget-backward) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index abcbfa1..dfdcd05 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -87,6 +87,11 @@ the user hasn't set this variable with the old or new value." "Return the user.primary_email value from the notmuch configuration." (notmuch-config-get "user.primary_email")) +(defun notmuch-kill-this-buffer () + "Kill the current buffer." + (interactive) + (kill-buffer (current-buffer))) + ;; ;; XXX: This should be a generic function in emacs somewhere, not diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 7ec6aa5..6b2268f 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -555,7 +555,7 @@ function is used. " (defvar notmuch-show-mode-map (let ((map (make-sparse-keymap))) (define-key map "?" 'notmuch-help) - (define-key map "q" 'kill-this-buffer) + (define-key map "q" 'notmuch-kill-this-buffer) (define-key map (kbd "") 'widget-backward) (define-key map (kbd "M-TAB") 'notmuch-show-previous-button) (define-key map (kbd "") 'notmuch-show-previous-button) @@ -1038,7 +1038,7 @@ argument, hide all of the messages." until (not (notmuch-show-goto-message-next))) ;; Move to the next item in the search results, if any. (let ((parent-buffer notmuch-show-parent-buffer)) - (kill-this-buffer) + (notmuch-kill-this-buffer) (if parent-buffer (progn (switch-to-buffer parent-buffer) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 2a87ab9..4a9223e 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -232,7 +232,7 @@ For a mouse binding, return nil." "Exit the search buffer, calling any defined continuation function." (interactive) (let ((continuation notmuch-search-continuation)) - (kill-this-buffer) + (notmuch-kill-this-buffer) (when continuation (funcall continuation)))) @@ -824,7 +824,7 @@ same relative position within the new buffer." (target-thread (notmuch-search-find-thread-id)) (query notmuch-search-query-string) (continuation notmuch-search-continuation)) - (kill-this-buffer) + (notmuch-kill-this-buffer) (notmuch-search query oldest-first target-thread target-line continuation) (goto-char (point-min)))) -- 1.7.2.3