From: Mark Walters Date: Tue, 29 Oct 2013 22:55:38 +0000 (+0000) Subject: [PATCH 11/11] emacs: move the show entry to tree into show.el X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b9142ece32f65f5c7eaf04226a4ce5feb31cf1e0;p=notmuch-archives.git [PATCH 11/11] emacs: move the show entry to tree into show.el --- diff --git a/05/a98db29c90f06f988568e6f7885a7c26b9fe67 b/05/a98db29c90f06f988568e6f7885a7c26b9fe67 new file mode 100644 index 000000000..43256129c --- /dev/null +++ b/05/a98db29c90f06f988568e6f7885a7c26b9fe67 @@ -0,0 +1,136 @@ +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 B6962421169 + for ; Tue, 29 Oct 2013 15:56:55 -0700 (PDT) +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 FrPdP72x0EOO for ; + Tue, 29 Oct 2013 15:56:50 -0700 (PDT) +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 + DAC95429E4B for ; Tue, 29 Oct 2013 15:56:02 -0700 + (PDT) +Received: by mail-wg0-f50.google.com with SMTP id n12so550112wgh.29 + for ; Tue, 29 Oct 2013 15:56:01 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=2Tcv2CSocTH6Y2WyrQa6xFZ0FeVkRZGnxf92aUL1Vec=; + b=jP0hiuin9550k5hgxfycTe1qhRyK/R83tp6eLiENWruCUuKyThmtc3+t4oYywoFfLe + uUAWV8n4f3qsnuP7sKWMBl+FddIcvAra9+WIb+e8nwV6VJhNBU9Nmm/8BvDzpB1vS5Bt + iKUkyIt4NGKA1ukojHinaNBAhxVJTCgaEXYnE5ApNFE+T0lz2/06Q2Wy8gs1M0EvypUc + wjS89hhc8PEnzCvTBAs3k/e1EYmv/uIVhWss2r2l4/qLrJZ8fPc1dpRYnrKeEvfm3QjH + hz7dQadIQA0Hp7PGabEW8Zs1Mz7R5VQYPUhpDbp2WjtuOb0RGJDH2HtfmaGsKw4K8kl/ + ZGgg== +X-Received: by 10.194.171.34 with SMTP id ar2mr10033wjc.81.1383087361785; + Tue, 29 Oct 2013 15:56:01 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id y20sm9517051wib.0.2013.10.29.15.56.01 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Tue, 29 Oct 2013 15:56:01 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 11/11] emacs: move the show entry to tree into show.el +Date: Tue, 29 Oct 2013 22:55:38 +0000 +Message-Id: <1383087338-10220-12-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1383087338-10220-1-git-send-email-markwalters1009@gmail.com> +References: <1383087338-10220-1-git-send-email-markwalters1009@gmail.com> +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: Tue, 29 Oct 2013 22:56:56 -0000 + +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 "") 'widget-backward) + (define-key map (kbd "M-TAB") 'notmuch-show-previous-button) + (define-key map (kbd "") '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 +