unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] Don't use kill-this-buffer to kill notmuch emacs buffers
@ 2010-11-06 20:49 Jameson Rollins
  2010-11-08 17:09 ` Carl Worth
  0 siblings, 1 reply; 3+ messages in thread
From: Jameson Rollins @ 2010-11-06 20:49 UTC (permalink / raw)
  To: Notmuch Mail

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 "<C-tab>") '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 "<C-tab>") 'widget-backward)
 	(define-key map (kbd "M-TAB") 'notmuch-show-previous-button)
 	(define-key map (kbd "<backtab>") '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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] Don't use kill-this-buffer to kill notmuch emacs buffers
  2010-11-06 20:49 [PATCH 1/2] Don't use kill-this-buffer to kill notmuch emacs buffers Jameson Rollins
@ 2010-11-08 17:09 ` Carl Worth
  2010-11-08 18:56   ` Jameson Rollins
  0 siblings, 1 reply; 3+ messages in thread
From: Carl Worth @ 2010-11-08 17:09 UTC (permalink / raw)
  To: Jameson Rollins, Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

On Sat, 6 Nov 2010 16:49:28 -0400, Jameson Rollins <jrollins@finestructure.net> wrote:
> 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)).

Thanks. I've pushed this now.

-Carl

PS. Was there no [PATCH 2/2] to follow this one?

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] Don't use kill-this-buffer to kill notmuch emacs buffers
  2010-11-08 17:09 ` Carl Worth
@ 2010-11-08 18:56   ` Jameson Rollins
  0 siblings, 0 replies; 3+ messages in thread
From: Jameson Rollins @ 2010-11-08 18:56 UTC (permalink / raw)
  To: Carl Worth, Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

On Mon, 08 Nov 2010 09:09:20 -0800, Carl Worth <cworth@cworth.org> wrote:
> PS. Was there no [PATCH 2/2] to follow this one?

doh!  Sorry, no, there was only one patch. I made a mistake when I ran
format-patch and it exported multiple patches and I forgot to fix the
subject.  Thanks!

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-08 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-06 20:49 [PATCH 1/2] Don't use kill-this-buffer to kill notmuch emacs buffers Jameson Rollins
2010-11-08 17:09 ` Carl Worth
2010-11-08 18:56   ` Jameson Rollins

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).