Re: BUG: bad notmuch shared library install_name on Mac OS X
[notmuch-archives.git] / 85 / c3138b6a36abc5428c4fef320ce385b9fcd138
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 8BABF431FD7\r
6         for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:18:04 -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: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 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         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 StzzUjPrxCuO for <notmuch@notmuchmail.org>;\r
18         Tue, 12 Nov 2013 12:17:58 -0800 (PST)\r
19 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
20         [209.85.212.181]) (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 CF432431FCF\r
23         for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:17:57 -0800 (PST)\r
24 Received: by mail-wi0-f181.google.com with SMTP id f4so617394wiw.14\r
25         for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:17:56 -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:in-reply-to:references;\r
28         bh=ICVpgctOq3VK9xNLH18+fEKS/0O162OYUXgyxgGmz9I=;\r
29         b=xVW/d9Tpmx1+Efd+rMMXKW+X2UNk+bIWlOz3nCxrogTk0KcYI7rmrPV2TuMLOwAqIm\r
30         fUF1WL9B55Dhny1KZH6q6B0fKfBGAS7hF/cJL4eM2p+SU5l5ZP6I3Mt7WAsYcuRSO6Si\r
31         E6l2HPaFydyyWpkbsFrZb+huI+kPp4dmlzxrVqYpJf/Di0fHbsSDRR+RMwPMR7A0qj0o\r
32         JC/yB6k4ea20coN81VhaVc9itU0QDDN8z25Sa6FROLPTZFoKPI9pfNBPMm6JSg4eqMgC\r
33         owPlkhdMkRSPb+OJ4sSBX8MO5eias7H6bdYiLYBHLLiUKEF3L9zB25qrwlPKQ4t2c+CI\r
34         DUWA==\r
35 X-Received: by 10.180.78.132 with SMTP id b4mr4666796wix.0.1384287070016;\r
36         Tue, 12 Nov 2013 12:11:10 -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\r
39         qc10sm48006738wic.9.2013.11.12.12.11.09 for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Tue, 12 Nov 2013 12:11:09 -0800 (PST)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH v4 3/7] emacs: help: remove duplicate bindings\r
45 Date: Tue, 12 Nov 2013 20:10:55 +0000\r
46 Message-Id: <1384287059-3525-4-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Tue, 12 Nov 2013 20:18:04 -0000\r
63 \r
64 If the user (or a mode) overrides a keybinding from the common keymap\r
65 in one of the modes then both help lines appear in the help screen\r
66 even though only one of them is applicable.\r
67 \r
68 Fix this by checking if we already have that key binding. We do this\r
69 by constructing an list of (key . docstring) pairs so it is easy to\r
70 check if we have already had that binding. Then the actual print help\r
71 routine changes these pairs into strings "key \t docstring"\r
72 ---\r
73  emacs/notmuch-lib.el |   41 ++++++++++++++++++++++++-----------------\r
74  1 files changed, 24 insertions(+), 17 deletions(-)\r
75 \r
76 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
77 index 6abc4ea..dde636a 100644\r
78 --- a/emacs/notmuch-lib.el\r
79 +++ b/emacs/notmuch-lib.el\r
80 @@ -238,11 +238,12 @@ This is basically just `format-kbd-macro' but we also convert ESC to M-."\r
81        (concat desc " "))))\r
82  \r
83  (defun notmuch-describe-keymap (keymap ua-keys &optional prefix tail)\r
84 -  "Return a list of strings, each describing one binding in KEYMAP.\r
85 +  "Return a list of cons cells, each describing one binding in KEYMAP.\r
86  \r
87 -Each string gives a human-readable description of the key and a\r
88 -one-line description of the bound function.  See `notmuch-help'\r
89 -for an overview of how this documentation is extracted.\r
90 +Each cons cell consists of a string giving a human-readable\r
91 +description of the key, and a one-line description of the bound\r
92 +function.  See `notmuch-help' for an overview of how this\r
93 +documentation is extracted.\r
94  \r
95  UA-KEYS should be a key sequence bound to `universal-argument'.\r
96  It will be used to describe bindings of commands that support a\r
97 @@ -255,18 +256,23 @@ prefix argument.  PREFIX and TAIL are used internally."\r
98                   (notmuch-describe-keymap\r
99                    binding ua-keys (notmuch-prefix-key-description key) tail)))\r
100            (binding\r
101 -           (when (and ua-keys (symbolp binding)\r
102 -                      (get binding 'notmuch-prefix-doc))\r
103 -             ;; Documentation for prefixed command\r
104 -             (let ((ua-desc (key-description ua-keys)))\r
105 -               (push (concat ua-desc " " prefix (format-kbd-macro (vector key))\r
106 -                             "\t" (get binding 'notmuch-prefix-doc))\r
107 -                     tail)))\r
108 -           ;; Documentation for command\r
109 -           (push (concat prefix (format-kbd-macro (vector key)) "\t"\r
110 -                         (or (and (symbolp binding) (get binding 'notmuch-doc))\r
111 -                             (notmuch-documentation-first-line binding)))\r
112 -                 tail))))\r
113 +           (let ((key-string (concat prefix (format-kbd-macro (vector key)))))\r
114 +             ;; We don't include documentation if the key-binding is\r
115 +             ;; over-ridden. Note, over-riding a binding\r
116 +             ;; automatically hides the prefixed version too.\r
117 +             (unless (assoc key-string tail)\r
118 +               (when (and ua-keys (symbolp binding)\r
119 +                          (get binding 'notmuch-prefix-doc))\r
120 +                 ;; Documentation for prefixed command\r
121 +                 (let ((ua-desc (key-description ua-keys)))\r
122 +                   (push (cons (concat ua-desc " " prefix (format-kbd-macro (vector key)))\r
123 +                               (get binding 'notmuch-prefix-doc))\r
124 +                         tail)))\r
125 +               ;; Documentation for command\r
126 +               (push (cons key-string\r
127 +                           (or (and (symbolp binding) (get binding 'notmuch-doc))\r
128 +                               (notmuch-documentation-first-line binding)))\r
129 +                     tail))))))\r
130     keymap)\r
131    tail)\r
132  \r
133 @@ -279,7 +285,8 @@ prefix argument.  PREFIX and TAIL are used internally."\r
134                (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))\r
135                       (keymap (symbol-value (intern keymap-name)))\r
136                       (ua-keys (where-is-internal 'universal-argument keymap t))\r
137 -                     (desc-list (notmuch-describe-keymap keymap ua-keys)))\r
138 +                     (desc-alist (notmuch-describe-keymap keymap ua-keys))\r
139 +                     (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)))\r
140                  (mapconcat #'identity desc-list "\n")))))\r
141         (setq doc (replace-match desc 1 1 doc)))\r
142        (setq beg (match-end 0)))\r
143 -- \r
144 1.7.9.1\r
145 \r