Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 7a / f2c8cdff4f8b799c99839d72330f7d694cdef1
1 Return-Path: <amdragon@mit.edu>\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 2F323431FAE\r
6         for <notmuch@notmuchmail.org>; Wed, 29 May 2013 18:14:20 -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: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id fdr8zm-u3z5E for <notmuch@notmuchmail.org>;\r
16         Wed, 29 May 2013 18:14:13 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu\r
18         [18.9.25.12])\r
19         by olra.theworths.org (Postfix) with ESMTP id 374F9431FC3\r
20         for <notmuch@notmuchmail.org>; Wed, 29 May 2013 18:14:04 -0700 (PDT)\r
21 X-AuditID: 1209190c-b7f566d000004c69-21-51a6a7dad847\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 64.FB.19561.AD7A6A15; Wed, 29 May 2013 21:14:02 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r4U1DtQE015112; \r
27         Wed, 29 May 2013 21:13:56 -0400\r
28 Received: from drake.dyndns.org (c-76-21-105-205.hsd1.ca.comcast.net\r
29         [76.21.105.205]) (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r4U1Dq0b003010\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Wed, 29 May 2013 21:13:54 -0400\r
34 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1UhrRA-0003Yw-9m; Wed, 29 May 2013 21:13:52 -0400\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v2 4/5] emacs: Bind MIME part commands to "." submap\r
40 Date: Wed, 29 May 2013 21:13:47 -0400\r
41 Message-Id: <1369876428-13537-5-git-send-email-amdragon@mit.edu>\r
42 X-Mailer: git-send-email 1.7.10.4\r
43 In-Reply-To: <1369876428-13537-1-git-send-email-amdragon@mit.edu>\r
44 References: <1369876428-13537-1-git-send-email-amdragon@mit.edu>\r
45 X-Brightmail-Tracker:\r
46  H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsUixG6nrntr+bJAg44Jwhar5/JYXL85k9mB\r
47         yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyui71ste0C5WMWvKbeYGxuVCXYycHBICJhI7\r
48         H95nhLDFJC7cW8/WxcjFISSwj1Hi/O+fLBDORkaJpZ/aoDKnmSQe/tnDDuHMZZQ49/MQM0g/\r
49         m4CGxLb9y8FmiQhIS+y8O5sVxGYWcJT4vH8RUDcHh7CAi8THc5IgYRYBVYmOWXcZQcK8Ag4S\r
50         U2eIQVyhKNH9bAIbiM0J1Pm+7TrYRCGgkuZvfUwTGPkXMDKsYpRNya3SzU3MzClOTdYtTk7M\r
51         y0st0jXUy80s0UtNKd3ECAojTkmeHYxvDiodYhTgYFTi4eXUXRYoxJpYVlyZe4hRkoNJSZR3\r
52         zVKgEF9SfkplRmJxRnxRaU5q8SFGCQ5mJRHeNdpAOd6UxMqq1KJ8mJQ0B4uSOO/llJv+QgLp\r
53         iSWp2ampBalFMFkZDg4lCd63y4AaBYtS01Mr0jJzShDSTBycIMN5gIZfBanhLS5IzC3OTIfI\r
54         n2JUlBLn/QySEABJZJTmwfXC4vwVozjQK8K8r0GqeIApAq77FdBgJqDB4syLQQaXJCKkpBoY\r
55         Yw5fqtU6ynz6rcup22L2iydbv9lz6tCE1LM6Lc/VVmSGuFQVJJ3dvnlF0bX66zac3xa+3/+V\r
56         xzkiR3xB15ZrcWVlmmrTtylcPOCUpbbWz6470qfx2oKgM1m190Lfvfpjk6KaoyGpHeZ+RsLL\r
57         4ns3ewrLJSW2VXsbWmurP9ZM/VsbKmYQ8yxdiaU4I9FQi7moOBEAl6+q+c4CAAA=\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Thu, 30 May 2013 01:14:20 -0000\r
71 \r
72 Since the part commands are no longer tied to a button, but can be\r
73 applied with point anywhere within a part, bind the part commands\r
74 keymap to "." everywhere in the show buffer.  This lets you save or\r
75 view parts without having to navigate to the part button, and is\r
76 particularly useful for parts that have no button.\r
77 \r
78 This removes the un-prefixed MIME part commands from the part button\r
79 keymap, but that's okay because those clashed in annoying ways with\r
80 show buffer bindings like "s" for search.  RET on part buttons is\r
81 unaffected, which is the most important part button binding.\r
82 ---\r
83  emacs/notmuch-show.el |   23 +++++++++++------------\r
84  1 file changed, 11 insertions(+), 12 deletions(-)\r
85 \r
86 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
87 index 0d9a34c..613e666 100644\r
88 --- a/emacs/notmuch-show.el\r
89 +++ b/emacs/notmuch-show.el\r
90 @@ -466,22 +466,10 @@ message at DEPTH in the current thread."\r
91  \r
92  (define-button-type 'notmuch-show-part-button-type\r
93    'action 'notmuch-show-part-button-default\r
94 -  'keymap 'notmuch-show-part-button-map\r
95    'follow-link t\r
96    'face 'message-mml\r
97    :supertype 'notmuch-button-type)\r
98  \r
99 -(defvar notmuch-show-part-button-map\r
100 -  (let ((map (make-sparse-keymap)))\r
101 -    (set-keymap-parent map button-map)\r
102 -    (define-key map "s" 'notmuch-show-save-part)\r
103 -    (define-key map "v" 'notmuch-show-view-part)\r
104 -    (define-key map "o" 'notmuch-show-interactively-view-part)\r
105 -    (define-key map "|" 'notmuch-show-pipe-part)\r
106 -    map)\r
107 -  "Submap for button commands")\r
108 -(fset 'notmuch-show-part-button-map notmuch-show-part-button-map)\r
109 -\r
110  (defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)\r
111    (let ((button)\r
112         (base-label (concat (when name (concat name ": "))\r
113 @@ -1202,6 +1190,16 @@ reset based on the original query."\r
114    "Submap for stash commands")\r
115  (fset 'notmuch-show-stash-map notmuch-show-stash-map)\r
116  \r
117 +(defvar notmuch-show-part-map\r
118 +  (let ((map (make-sparse-keymap)))\r
119 +    (define-key map "s" 'notmuch-show-save-part)\r
120 +    (define-key map "v" 'notmuch-show-view-part)\r
121 +    (define-key map "o" 'notmuch-show-interactively-view-part)\r
122 +    (define-key map "|" 'notmuch-show-pipe-part)\r
123 +    map)\r
124 +  "Submap for part commands")\r
125 +(fset 'notmuch-show-part-map notmuch-show-part-map)\r
126 +\r
127  (defvar notmuch-show-mode-map\r
128        (let ((map (make-sparse-keymap)))\r
129         (define-key map "?" 'notmuch-help)\r
130 @@ -1244,6 +1242,7 @@ reset based on the original query."\r
131         (define-key map "$" 'notmuch-show-toggle-process-crypto)\r
132         (define-key map "<" 'notmuch-show-toggle-thread-indentation)\r
133         (define-key map "t" 'toggle-truncate-lines)\r
134 +       (define-key map "." 'notmuch-show-part-map)\r
135         map)\r
136        "Keymap for \"notmuch show\" buffers.")\r
137  (fset 'notmuch-show-mode-map notmuch-show-mode-map)\r
138 -- \r
139 1.7.10.4\r
140 \r