[PATCH v2 11/11] emacs: move the show entry to tree into show.el

Mark Walters markwalters1009 at gmail.com
Fri Nov 1 02:23:45 PDT 2013


Move the keybinding and show specific helper from tree.el to show.el
---
 emacs/notmuch-show.el |   10 ++++++++++
 emacs/notmuch-tree.el |   12 +-----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 9e8b9c0..f00273a 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -44,6 +44,8 @@
 (declare-function notmuch-foreach-mime-part "notmuch" (function mm-handle))
 (declare-function notmuch-count-attachments "notmuch" (mm-handle))
 (declare-function notmuch-save-attachments "notmuch" (mm-handle &optional queryp))
+(declare-function notmuch-tree "notmuch-tree"
+		  (&optional query query-context target buffer-name open-target))
 
 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
   "Headers that should be shown in a message, in this order.
@@ -1247,6 +1249,7 @@ reset based on the original query."
 (defvar notmuch-show-mode-map
       (let ((map (make-sparse-keymap)))
 	(set-keymap-parent map notmuch-common-keymap)
+	(define-key map "Z" 'notmuch-tree-from-show-current-query)
 	(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)
@@ -1323,6 +1326,13 @@ All currently available key bindings:
   (setq buffer-read-only t
 	truncate-lines t))
 
+(defun notmuch-tree-from-show-current-query ()
+  "Call notmuch tree with the current query"
+  (interactive)
+  (notmuch-tree notmuch-show-thread-id
+		notmuch-show-query-context
+		(notmuch-show-get-message-id)))
+
 (defun notmuch-show-move-to-message-top ()
   (goto-char (notmuch-show-message-top)))
 
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index c66dd35..f13b41f 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -404,15 +404,6 @@ Does NOT change the database."
     (notmuch-tree-close-message-window)
     (notmuch-tree query)))
 
-;; This function should be in notmuch-show.el but be we trying to
-;; minimise impact on the rest of the codebase.
-(defun notmuch-tree-from-show-current-query ()
-  "Call notmuch tree with the current query"
-  (interactive)
-  (notmuch-tree notmuch-show-thread-id
-		notmuch-show-query-context
-		(notmuch-show-get-message-id)))
-
 (defun notmuch-tree-message-window-kill-hook ()
   "Close the message pane when exiting the show buffer."
   (let ((buffer (current-buffer)))
@@ -918,7 +909,6 @@ The arguments are:
   (setq truncate-lines t))
 
 
-;; Set up key bindings from the rest of notmuch.
-(define-key notmuch-show-mode-map "Z" 'notmuch-tree-from-show-current-query)
+;;
 
 (provide 'notmuch-tree)
-- 
1.7.9.1



More information about the notmuch mailing list