Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b0 / 83d52c3144d328049ea29d4c791dc834af3ac5
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 09232429E39\r
6         for <notmuch@notmuchmail.org>; Fri,  8 Nov 2013 09:40:40 -0800 (PST)\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 d7fTxdfY68Ww for <notmuch@notmuchmail.org>;\r
18         Fri,  8 Nov 2013 09:40:34 -0800 (PST)\r
19 Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com\r
20  [74.125.82.47])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  23B93431FDE    for <notmuch@notmuchmail.org>; Fri,  8 Nov 2013 09:40:28 -0800\r
23  (PST)\r
24 Received: by mail-wg0-f47.google.com with SMTP id c11so2276874wgh.14\r
25         for <notmuch@notmuchmail.org>; Fri, 08 Nov 2013 09:40:25 -0800 (PST)\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;\r
28         bh=1moXW+By+9yTflAVMIyRQPcFePHEFWoqOhhDXYUo9Ek=;\r
29         b=059QzF9J1KjmFpWRrHfdtT9whjZnR7l7LacWLBykYppltVCIODzFiCsp34W6V9baxD\r
30         Df1/KchxlOqTPfnrZmkgt8j1buQQGud+H56uJpf1nTkT0Y8skewiwPfIlIyaQU5gMCci\r
31         RxUlj0KOQZmxofmUk66yv3BDs4I+OsTGZD79GSZ+kFKFjUwAy7+pxgdcOMXH4ZDzrI3/\r
32         0W5bcM8n4t7tqNaa9YLZrJPP+B353EVQMzFtrps+5MVRLx2NZiVJD19oVuN650XyeR2h\r
33         pJqa5+0cGpDWCg7JPMMS7YAXomiQpVlPZI71Ihhi+0VwEO25MZeQj6J4h30wy3WV1I7K\r
34         G/Aw==\r
35 X-Received: by 10.180.94.38 with SMTP id cz6mr3255559wib.27.1383932423260;\r
36         Fri, 08 Nov 2013 09:40:23 -0800 (PST)\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 td6sm7508300wic.10.2013.11.08.09.40.22\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Fri, 08 Nov 2013 09:40:22 -0800 (PST)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH v3 0/7] emacs: help: remap keybindings\r
45 Date: Fri,  8 Nov 2013 17:40:12 +0000\r
46 Message-Id: <1383932419-12533-1-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Fri, 08 Nov 2013 17:40:40 -0000\r
61 \r
62 This is version 3 of the series. v2 is at\r
63 id:1383870096-14627-1-git-send-email-markwalters1009@gmail.com\r
64 \r
65 The changes are in response to Austin's review of v2. I have not\r
66 changed notmuch-describe-key.\r
67 \r
68 The other change is to add a base-keymap to look up the remapped\r
69 commands in (since notmuch-substitute-command-keys could refer to\r
70 something other than the current keymap). Currently this never happens\r
71 but this makes the code more robust.\r
72 \r
73 The final patch of the series is (probably) just for testing\r
74 purposes. It lets you call notmuch-help and specify which mode you\r
75 want to display help for. This means you can call it without having\r
76 the mode as current-mode and hence test the base-keymap code.\r
77 \r
78 Finally the diff from v2 below (with the testing patch omitted) is below.\r
79 \r
80 Best wishes\r
81 \r
82 Mark\r
83 \r
84 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
85 index ef616d5..4b3a86e 100644\r
86 --- a/emacs/notmuch-lib.el\r
87 +++ b/emacs/notmuch-lib.el\r
88 @@ -261,7 +261,7 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL."\r
89             tail)))\r
90      tail)\r
91  \r
92 -(defun notmuch-describe-remaps (remap-keymap ua-keys prefix tail)\r
93 +(defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)\r
94    ;; Remappings are represented as a binding whose first "event" is\r
95    ;; 'remap.  Hence, if the keymap has any remappings, it will have a\r
96    ;; binding whose "key" is 'remap, and whose "binding" is itself a\r
97 @@ -272,11 +272,11 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL."\r
98       (mapc\r
99        (lambda (actual-key)\r
100         (setq tail (notmuch-describe-key actual-key binding prefix ua-keys tail)))\r
101 -      (where-is-internal command)))\r
102 +      (where-is-internal command base-keymap)))\r
103     remap-keymap)\r
104    tail)\r
105  \r
106 -(defun notmuch-describe-keymap (keymap ua-keys &optional prefix tail)\r
107 +(defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail)\r
108    "Return a list of cons cells, each describing one binding in KEYMAP.\r
109  \r
110  Each cons cell consists of a string giving a human-readable\r
111 @@ -291,13 +291,12 @@ prefix argument.  PREFIX and TAIL are used internally."\r
112     (lambda (key binding)\r
113       (cond ((mouse-event-p key) nil)\r
114            ((keymapp binding)\r
115 -           (if (eq key 'remap)\r
116 -               (setq tail\r
117 +           (setq tail\r
118 +                 (if (eq key 'remap)\r
119                       (notmuch-describe-remaps\r
120 -                      binding ua-keys prefix tail))\r
121 -             (setq tail\r
122 +                      binding ua-keys base-keymap prefix tail)\r
123                     (notmuch-describe-keymap\r
124 -                    binding ua-keys (notmuch-prefix-key-description key) tail))))\r
125 +                    binding ua-keys base-keymap (notmuch-prefix-key-description key) tail))))\r
126            (binding\r
127             (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail)))))\r
128     keymap)\r
129 @@ -310,7 +309,7 @@ prefix argument.  PREFIX and TAIL are used internally."\r
130        (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))\r
131              (keymap (symbol-value (intern keymap-name)))\r
132              (ua-keys (where-is-internal 'universal-argument keymap t))\r
133 -            (desc-alist (notmuch-describe-keymap keymap ua-keys))\r
134 +            (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))\r
135              (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))\r
136              (desc (mapconcat #'identity desc-list "\n")))\r
137         (setq doc (replace-match desc 1 1 doc)))\r
138 \r
139 \r
140 \r
141 Mark Walters (7):\r
142   emacs: help: check for nil key binding\r
143   emacs: help: remove duplicate bindings\r
144   emacs: help: split out notmuch-describe-key as a function\r
145   emacs: help: add base-keymap\r
146   emacs: help: add a special function to deal with remaps\r
147   emacs: tree: use remap for the over-ridden global bindings\r
148   emacs: help: base-keymap-test-help\r
149 \r
150  emacs/notmuch-lib.el  |   79 ++++++++++++++++++++++++++++++++++--------------\r
151  emacs/notmuch-tree.el |    8 ++--\r
152  2 files changed, 60 insertions(+), 27 deletions(-)\r
153 \r
154 \r
155 \r
156 \r
157 -- \r
158 1.7.9.1\r
159 \r