Re: [PATCH] emacs: address completion, allow sender/recipient and filters
[notmuch-archives.git] / c0 / 645d45fba902e11cb46e8896ee1017a509a2b9
1 Return-Path: <m.walters@qmul.ac.uk>\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 CEA15431FD7\r
6         for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 12:04:51 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id nbXHf+-nV7tB for <notmuch@notmuchmail.org>;\r
17         Mon, 26 Aug 2013 12:04:47 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 01338431FAF\r
22         for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 12:04:46 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1VDXVC-000281-0T; Sun, 25 Aug 2013 11:25:01 +0100\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1VDXVB-00018j-M4; Sun, 25 Aug 2013 11:24:57 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH 1/1] emacs: add '?' to some prefix keymaps to describe its\r
34         bindings\r
35 In-Reply-To: <1377346540-7094-1-git-send-email-tomi.ollila@iki.fi>\r
36 References: <1377346540-7094-1-git-send-email-tomi.ollila@iki.fi>\r
37 User-Agent: Notmuch/0.15.2+269~g01f5508 (http://notmuchmail.org) Emacs/23.4.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Sun, 25 Aug 2013 11:24:56 +0100\r
40 Message-ID: <8761uu2hl3.fsf@qmul.ac.uk>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 X-Sender-Host-Address: 93.97.24.31\r
44 X-QM-SPAM-Info: Sender has good ham record.  :)\r
45 X-QM-Body-MD5: 5ea73a0ceb601597eb8dab528fbda68d (of first 20000 bytes)\r
46 X-SpamAssassin-Score: 0.0\r
47 X-SpamAssassin-SpamBar: /\r
48 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
49         determine if it is\r
50         spam. We require at least 5.0 points to mark a message as spam.\r
51         This message scored 0.0 points. Summary of the scoring: \r
52         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
53         provider *      (markwalters1009[at]gmail.com)\r
54         *  0.0 AWL AWL: From: address is in the auto white-list\r
55 X-QM-Scan-Virus: ClamAV says the message is clean\r
56 Cc: tomi.ollila@iki.fi\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Mon, 26 Aug 2013 19:04:51 -0000\r
70 \r
71 \r
72 On Sat, 24 Aug 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
73 > Added (private) function `notmuch--prefix-bindings' which wraps\r
74 > `describe-prefix-bindings' to provide more suitable user interface for\r
75 > showing the key sequences that follow a particular notmuch prefix\r
76 > keymap invocation.\r
77 >\r
78 > The key '?' in prefix keymaps `notmuch-search-stash-map',\r
79 > `notmuch-show-stash-map' and `notmuch-show-part-map' is bound to this\r
80 > function via `lambda' expression. By using this lambda expression the\r
81 > pop-up binding description window shows '??' instead of\r
82 > `notmuch--prefix-bindings' for the binding of '?' -- which suits our\r
83 > needs perfectly.\r
84 \r
85 This looks good to me +1. \r
86 \r
87 [I think I would prefer docstrings to function names but getting that\r
88 does not seem to be easy so is probably not worth the effort.]\r
89 \r
90 Best wishes\r
91 \r
92 Mark\r
93 \r
94 \r
95 > ---\r
96 >  emacs/notmuch-lib.el  | 9 +++++++++\r
97 >  emacs/notmuch-show.el | 2 ++\r
98 >  emacs/notmuch.el      | 1 +\r
99 >  3 files changed, 12 insertions(+)\r
100 >\r
101 > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
102 > index 4796f17..8191aec 100644\r
103 > --- a/emacs/notmuch-lib.el\r
104 > +++ b/emacs/notmuch-lib.el\r
105 > @@ -553,6 +553,15 @@ status."\r
106 >         (message "%s" (error-message-string err))))\r
107 >      (ignore-errors (delete-file err-file))))\r
108 >  \r
109 > +(defun notmuch--prefix-bindings ()\r
110 > +  "Notmuch private wrapper for `describe-prefix-bindings'."\r
111 > +  ;;(interactive)\r
112 > +  (describe-prefix-bindings)\r
113 > +  (pop-to-buffer "*Help*") ; XXX that's what describe-bindings-internal uses\r
114 > +  (let ((buffer-read-only nil))\r
115 > +    (goto-char (point-min))\r
116 > +    (insert "\nPress 'q' to quit this window.\n\n")))\r
117 > +\r
118 >  ;; This variable is used only buffer local, but it needs to be\r
119 >  ;; declared globally first to avoid compiler warnings.\r
120 >  (defvar notmuch-show-process-crypto nil)\r
121 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
122 > index 82b70ba..98bf3d4 100644\r
123 > --- a/emacs/notmuch-show.el\r
124 > +++ b/emacs/notmuch-show.el\r
125 > @@ -1248,6 +1248,7 @@ reset based on the original query."\r
126 >      (define-key map "t" 'notmuch-show-stash-to)\r
127 >      (define-key map "l" 'notmuch-show-stash-mlarchive-link)\r
128 >      (define-key map "L" 'notmuch-show-stash-mlarchive-link-and-go)\r
129 > +    (define-key map "?" (lambda () (interactive) (notmuch--prefix-bindings)))\r
130 >      map)\r
131 >    "Submap for stash commands")\r
132 >  (fset 'notmuch-show-stash-map notmuch-show-stash-map)\r
133 > @@ -1258,6 +1259,7 @@ reset based on the original query."\r
134 >      (define-key map "v" 'notmuch-show-view-part)\r
135 >      (define-key map "o" 'notmuch-show-interactively-view-part)\r
136 >      (define-key map "|" 'notmuch-show-pipe-part)\r
137 > +    (define-key map "?" (lambda () (interactive) (notmuch--prefix-bindings)))\r
138 >      map)\r
139 >    "Submap for part commands")\r
140 >  (fset 'notmuch-show-part-map notmuch-show-part-map)\r
141 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
142 > index f3ce840..3a115c8 100644\r
143 > --- a/emacs/notmuch.el\r
144 > +++ b/emacs/notmuch.el\r
145 > @@ -245,6 +245,7 @@ For a mouse binding, return nil."\r
146 >  (defvar notmuch-search-stash-map\r
147 >    (let ((map (make-sparse-keymap)))\r
148 >      (define-key map "i" 'notmuch-search-stash-thread-id)\r
149 > +    (define-key map "?" (lambda () (interactive) (notmuch--prefix-bindings)))\r
150 >      map)\r
151 >    "Submap for stash commands")\r
152 >  (fset 'notmuch-search-stash-map notmuch-search-stash-map)\r
153 > -- \r
154 > 1.8.0\r
155 >\r
156 > _______________________________________________\r
157 > notmuch mailing list\r
158 > notmuch@notmuchmail.org\r
159 > http://notmuchmail.org/mailman/listinfo/notmuch\r