Re: [PATCH] lib: reword comment about XFOLDER: prefix
[notmuch-archives.git] / ec / efb4a83dccbf1e4463368333e6ea7104274c35
1 Return-Path: <markwalters1009@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 11CA4431FCF\r
6         for <notmuch@notmuchmail.org>; Wed,  2 Oct 2013 08:50:36 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 2.7\r
10 X-Spam-Level: **\r
11 X-Spam-Status: No, score=2.7 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id Kyd679zn5YYp for <notmuch@notmuchmail.org>;\r
18         Wed,  2 Oct 2013 08:50:28 -0700 (PDT)\r
19 Received: from mail-we0-f176.google.com (mail-we0-f176.google.com\r
20         [74.125.82.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 73F8B431FD4\r
23         for <notmuch@notmuchmail.org>; Wed,  2 Oct 2013 08:50:28 -0700 (PDT)\r
24 Received: by mail-we0-f176.google.com with SMTP id u56so1197320wes.21\r
25         for <notmuch@notmuchmail.org>; Wed, 02 Oct 2013 08:50:24 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
28         bh=7WxslFQCufTbTZlmZKYhG15BaEFkkXF4hvljChYI4ZM=;\r
29         b=JqeN4xBLl/HdCkFCsASzXsbhsZLHIQ54JMZyUG6MBWQzm+EIrELftqVS5sLHksJ7QW\r
30         EDDvYc4s2O2QGzAO4jLpppHZ7ZGrXdlCOQwWbhTLF+8npQCcufCHbmu/TI0BFd/6iPDg\r
31         hysIb/XEIqHcYmtz+osFfOQysviV9uN31O9UqVYitiMI3X7qIV0aR1SA7Rtz86HW4iPH\r
32         bBPlOYOuRlgTMPuqOjYuhwyb+zvvK3cxwVOSAYth5Y7eE2cDWk9/AiJiF0ZpMyOlIWZE\r
33         xvNqXHwX3EZ0S9Y8g2dXArk7dfJTNV3BbYG22pIlTuWrm1dbbUshRnuIpEo8e2fOOS4O\r
34         kvuA==\r
35 X-Received: by 10.180.187.169 with SMTP id ft9mr24242884wic.14.1380729023344; \r
36         Wed, 02 Oct 2013 08:50:23 -0700 (PDT)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPSA id i8sm4784010wiy.6.1969.12.31.16.00.00\r
39         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
40         Wed, 02 Oct 2013 08:50:22 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH (alternative)] emacs: show: tweak handling of prefix-arg\r
44 Date: Wed,  2 Oct 2013 16:50:13 +0100\r
45 Message-Id: <1380729013-3942-1-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 1.7.9.1\r
47 In-Reply-To: <1380718788-18165-1-git-send-email-markwalters1009@gmail.com>\r
48 References: <1380718788-18165-1-git-send-email-markwalters1009@gmail.com>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Wed, 02 Oct 2013 15:50:36 -0000\r
62 \r
63 Currently notmuch-show looks at the prefix-arg directly via\r
64 current-prefix-arg. This changes it to use the interactive\r
65 specification.\r
66 ---\r
67 \r
68 This alternative patch would avoid the problem described in\r
69 id:1380718788-18165-1-git-send-email-markwalters1009@gmail.com It\r
70 changes notmuch-show to use more standard interactive calls to get the\r
71 prefix arg.\r
72 \r
73 In fact my preference is for an even simpler solution: just remove the\r
74 prefix-arg functionality here. My main reason is that I would like to\r
75 use the prefix arg as the entry to pick (once pick is in mainline); it\r
76 would also simplify the code in notmuch-show. Of course it would remove\r
77 a little functionality.\r
78 \r
79 What do people think?\r
80 \r
81 Best wishes\r
82 \r
83 Mark\r
84 \r
85 \r
86 \r
87 \r
88  emacs/notmuch-show.el |    9 +++++----\r
89  emacs/notmuch.el      |    5 +++--\r
90  2 files changed, 8 insertions(+), 6 deletions(-)\r
91 \r
92 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
93 index 5d7e24b..f7fa6da 100644\r
94 --- a/emacs/notmuch-show.el\r
95 +++ b/emacs/notmuch-show.el\r
96 @@ -1080,13 +1080,13 @@ buttons for a corresponding notmuch search."\r
97         (make-text-button (first link) (second link)\r
98                           :type 'notmuch-button-type\r
99                           'action `(lambda (arg)\r
100 -                                    (notmuch-show ,(third link)))\r
101 +                                    (notmuch-show ,(third link) current-prefix-arg))\r
102                           'follow-link t\r
103                           'help-echo "Mouse-1, RET: search for this message"\r
104                           'face goto-address-mail-face)))))\r
105  \r
106  ;;;###autoload\r
107 -(defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name)\r
108 +(defun notmuch-show (thread-id &optional prefix parent-buffer query-context buffer-name)\r
109    "Run \"notmuch show\" with the given thread ID and display results.\r
110  \r
111  The optional PARENT-BUFFER is the notmuch-search buffer from\r
112 @@ -1102,7 +1102,8 @@ The optional BUFFER-NAME provides the name of the buffer in\r
113  which the message thread is shown. If it is nil (which occurs\r
114  when the command is called interactively) the argument to the\r
115  function is used."\r
116 -  (interactive "sNotmuch show: ")\r
117 +  (interactive "sNotmuch show: \r
118 +P")\r
119    (let ((buffer-name (generate-new-buffer-name\r
120                       (or buffer-name\r
121                           (concat "*notmuch-" thread-id "*")))))\r
122 @@ -1114,7 +1115,7 @@ function is used."\r
123      ;; `notmuch-show-elide-non-matching-messages' in this buffer. If\r
124      ;; there is a prefix argument, invert the default.\r
125      (setq notmuch-show-elide-non-matching-messages notmuch-show-only-matching-messages)\r
126 -    (if current-prefix-arg\r
127 +    (if prefix\r
128         (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages)))\r
129  \r
130      (setq notmuch-show-thread-id thread-id\r
131 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
132 index 0ff248b..5dda21f 100644\r
133 --- a/emacs/notmuch.el\r
134 +++ b/emacs/notmuch.el\r
135 @@ -486,13 +486,14 @@ If BARE is set then do not prefix with \"thread:\""\r
136    "Return a list of authors for the current region"\r
137    (notmuch-search-properties-in-region :subject beg end))\r
138  \r
139 -(defun notmuch-search-show-thread ()\r
140 +(defun notmuch-search-show-thread (&optional prefix)\r
141    "Display the currently selected thread."\r
142 -  (interactive)\r
143 +  (interactive "P")\r
144    (let ((thread-id (notmuch-search-find-thread-id))\r
145         (subject (notmuch-search-find-subject)))\r
146      (if (> (length thread-id) 0)\r
147         (notmuch-show thread-id\r
148 +                     prefix\r
149                       (current-buffer)\r
150                       notmuch-search-query-string\r
151                       ;; Name the buffer based on the subject.\r
152 -- \r
153 1.7.9.1\r
154 \r