Re: Flat search and threaded views
[notmuch-archives.git] / 6e / d9ea7fa8f76e73c42692a70b81aba41de27ba8
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 7C13F431FC2\r
6         for <notmuch@notmuchmail.org>; Sun, 10 Nov 2013 01:44:56 -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 ecEm8Z0nGG03 for <notmuch@notmuchmail.org>;\r
18         Sun, 10 Nov 2013 01:44:50 -0800 (PST)\r
19 Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com\r
20         [209.85.212.169]) (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 C2307431FAF\r
23         for <notmuch@notmuchmail.org>; Sun, 10 Nov 2013 01:44:49 -0800 (PST)\r
24 Received: by mail-wi0-f169.google.com with SMTP id cb5so1278423wib.0\r
25         for <notmuch@notmuchmail.org>; Sun, 10 Nov 2013 01:44:48 -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=7jpbeBLoh0GyU8mdI5OgUKAbKAO5H5xZ2MzgvOP3y2s=;\r
29         b=HEarD/ePFDollGjStg0C0RW5UA4qts1YdkzqWeadGMaxXclcGmVhIX2XgNPk6oQPdR\r
30         OdvCzHipntaQLIQfEw131F63blaayAFONSC4qFiQafYSB2V1/0N6DRa0eStv/mOz1j9c\r
31         kATC2bGEIBfZWrBnEOL79c2o5vhlhJyd/mPTyq1nwe3jzLU+7NuaFJUAwzkQ2fwPIyyV\r
32         SNyI0pKN17gnpSRq7ZNKHBtr4vm2rJAJtW6+ecV62axQ8qx7GliKI3If0gA+IhhojyAs\r
33         gtTWM88sdRGRFAo36M8PxbD78T/xp2Fm1csY9lcXQaOkmtqqvsXSvyuE7FW+9NOt2/L6\r
34         EOlg==\r
35 X-Received: by 10.180.75.142 with SMTP id c14mr8320132wiw.54.1384076687162;\r
36         Sun, 10 Nov 2013 01:44:47 -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 hv5sm22822963wib.2.2013.11.10.01.44.46\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Sun, 10 Nov 2013 01:44:46 -0800 (PST)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH] emacs: help: bugfix\r
45 Date: Sun, 10 Nov 2013 09:44:42 +0000\r
46 Message-Id: <1384076682-16872-1-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1383932419-12533-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1383932419-12533-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: Sun, 10 Nov 2013 09:44:56 -0000\r
63 \r
64 Hi\r
65 \r
66 David found a bug in the this remap/help series. He has a global\r
67 keybinding of "C-c s" for notmuch-search and this causes help in\r
68 tree-mode to hang.\r
69 \r
70 I have mostly diagnosed this: the problem comes that all the construct\r
71 help routines are inside a string-match/replace-match pair. Somewhere\r
72 in these routines the match-data is being stomped on (but I have to\r
73 admit I am not sure where).\r
74 \r
75 In any case putting the construct help routines inside a\r
76 save-match-data seems to fix it.\r
77 \r
78 This version is a bit ugly: I am not sure of the best way to deal with\r
79 the save-match-data macro. (I think it is best to have it round\r
80 everything that happens between finding the match and replacing the\r
81 match to avoid anything similar in future).\r
82 \r
83 This applies on top of the parent series.\r
84 \r
85 Any comments gratefully received!\r
86 \r
87 Best wishes\r
88 \r
89 Mark\r
90 \r
91 ---\r
92  emacs/notmuch-lib.el |   17 ++++++++++-------\r
93  1 files changed, 10 insertions(+), 7 deletions(-)\r
94 \r
95 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
96 index 7b8acb3..e98e073 100644\r
97 --- a/emacs/notmuch-lib.el\r
98 +++ b/emacs/notmuch-lib.el\r
99 @@ -305,13 +305,16 @@ prefix argument.  PREFIX and TAIL are used internally."\r
100  (defun notmuch-substitute-command-keys (doc)\r
101    "Like `substitute-command-keys' but with documentation, not function names."\r
102    (let ((beg 0))\r
103 -    (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg)\r
104 -      (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))\r
105 -            (keymap (symbol-value (intern keymap-name)))\r
106 -            (ua-keys (where-is-internal 'universal-argument keymap t))\r
107 -            (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))\r
108 -            (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))\r
109 -            (desc (mapconcat #'identity desc-list "\n")))\r
110 +    (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg) ;; matches \{not-space}\r
111 +      (let ((desc\r
112 +            (save-match-data\r
113 +              (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))\r
114 +                     (keymap (symbol-value (intern keymap-name)))\r
115 +                     (ua-keys (where-is-internal 'universal-argument keymap t))\r
116 +                     (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))\r
117 +                     (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))\r
118 +                     (desc (mapconcat #'identity desc-list "\n")))\r
119 +                desc))))\r
120         (setq doc (replace-match desc 1 1 doc)))\r
121        (setq beg (match-end 0)))\r
122      doc))\r
123 -- \r
124 1.7.9.1\r
125 \r