From 89a8d637afe4594ed18f0848b2b828a920e9b05a Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Fri, 1 Nov 2013 09:23:45 +0000 Subject: [PATCH] [PATCH v2 11/11] emacs: move the show entry to tree into show.el --- c4/23fccaf43ad2cdee02a466fff7308377bdeea4 | 137 ++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 c4/23fccaf43ad2cdee02a466fff7308377bdeea4 diff --git a/c4/23fccaf43ad2cdee02a466fff7308377bdeea4 b/c4/23fccaf43ad2cdee02a466fff7308377bdeea4 new file mode 100644 index 000000000..2ccb70c2e --- /dev/null +++ b/c4/23fccaf43ad2cdee02a466fff7308377bdeea4 @@ -0,0 +1,137 @@ +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 B4382429E3D + for ; Fri, 1 Nov 2013 02:24:23 -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 tTDDwnsgYAaM for ; + Fri, 1 Nov 2013 02:24:19 -0700 (PDT) +Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com + [209.85.212.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D8298431FD0 + for ; Fri, 1 Nov 2013 02:24:14 -0700 (PDT) +Received: by mail-wi0-f180.google.com with SMTP id ey11so801279wid.7 + for ; Fri, 01 Nov 2013 02:24:13 -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=l+UsVRGoICXwKEkVDwNo6N+iyzJigoqPaDxDeQ5ljBXVc5uUTi3mtlFesVkcwqsEn2 + YtXxkU60TzQSSeyUeO/M1TnV2QAKCSM7+pX+vHnpzo9YR1C1NLQe5Gwuhpa+BY6bABzJ + 0KTdajMfyFfTQoN5oo3AouQxH+/UrqDPjAvPPSpkAsMXg92FWEOgMu75q0sS+KBm98Eo + HQWJNUGIF0Z4yfbXqiUQkZOkB11MP1oC0yOlB+5zrvO4Dom4QqsN8EWNB+0tKDJmj98b + jP21oWsd1jk/DMS707VFvGblO6/5L7avVy7MR9wuBLf/4eAaxw6PjzRL/0w8EzGh+nAd + 1Dsw== +X-Received: by 10.180.76.114 with SMTP id j18mr1651740wiw.35.1383297853833; + Fri, 01 Nov 2013 02:24:13 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id fr4sm4524846wib.0.2013.11.01.02.24.13 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Fri, 01 Nov 2013 02:24:13 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v2 11/11] emacs: move the show entry to tree into show.el +Date: Fri, 1 Nov 2013 09:23:45 +0000 +Message-Id: <1383297825-12326-6-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1383297825-12326-1-git-send-email-markwalters1009@gmail.com> +References: <1383087338-10220-1-git-send-email-markwalters1009@gmail.com> + <1383297825-12326-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: Fri, 01 Nov 2013 09:24:24 -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 + -- 2.26.2