Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 09333431FD7 for ; Tue, 12 Nov 2013 14:46:34 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XbQHPjNUy3J4 for ; Tue, 12 Nov 2013 14:46:26 -0800 (PST) Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu [18.9.25.13]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 51255431FCF for ; Tue, 12 Nov 2013 14:46:26 -0800 (PST) X-AuditID: 1209190d-b7ef66d000000c40-98-5282afc1d99b Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id 3D.99.03136.1CFA2825; Tue, 12 Nov 2013 17:46:25 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id rACMkOdj025468; Tue, 12 Nov 2013 17:46:25 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rACMkMDp022443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 12 Nov 2013 17:46:24 -0500 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) (envelope-from ) id 1VgMj0-000725-NV; Tue, 12 Nov 2013 17:46:22 -0500 Date: Tue, 12 Nov 2013 17:46:22 -0500 From: Austin Clements To: Mark Walters Subject: Re: [PATCH v4 0/7] emacs: help: remap keybindings Message-ID: <20131112224622.GC13399@mit.edu> References: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IR4hTV1j24vinI4PtkXYvVc3ksrt+cyezA 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZUzc/YCp4LpIxbppTg2MCwS6GDk5JARMJPb3 f2KDsMUkLtxbD2RzcQgJzGaSWPLkIDuEs5FR4sv161CZ00wSs54vYIRwljBK3P3/gBmkn0VA VWL56sNgs9gENCS27V/OCGKLCOhI3D60gB3EZhaQlvj2u5kJxBYWsJJoW98FVs8LVPPw0W8W EFtIwEPi6JstTBBxQYmTM5+wQPRqSdz49xIozgE2Z/k/DpAwp4CnROObv2AniAqoSEw5uY1t AqPQLCTds5B0z0LoXsDIvIpRNiW3Sjc3MTOnODVZtzg5MS8vtUjXSC83s0QvNaV0EyM4qCV5 dzC+O6h0iFGAg1GJh9cipilIiDWxrLgy9xCjJAeTkihvxFqgEF9SfkplRmJxRnxRaU5q8SFG CQ5mJRFe6TVAOd6UxMqq1KJ8mJQ0B4uSOO9NDvsgIYH0xJLU7NTUgtQimKwMB4eSBO+EdUCN gkWp6akVaZk5JQhpJg5OkOE8QMOrQWp4iwsSc4sz0yHypxgVpcR5Z4MkBEASGaV5cL2wpPOK URzoFWHeepAqHmDCgut+BTSYCWiwRTHY4JJEhJRUA2NMjmq0drHOkZT3N63j/k6K8pgo25uv O6W/cnrJzZi+Wzc1m3Nro3+4JthXqzic5d/atOlA9VaZmTUK9jyvVqhvmzjxe9Fdg6Cu3RMK OaS6T+4/ckYzZMUdefXXV19WLo6u6ds6fb3cxeTK0tr6v0cdWDcdSe7jTdc8td9vdlFhr2BR WJ+MuxJLcUaioRZzUXEiAP+aZhAVAwAA Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Nov 2013 22:46:34 -0000 LGTM. Quoth Mark Walters on Nov 12 at 8:10 pm: > This is v4 of this patch set. v3 is at id:1383932419-12533-1-git-send-email-markwalters1009@gmail.com. > > David found a bug in v3 which I tracked down to some match-data being > over-written. This included the bugfix > id:1384076682-16872-1-git-send-email-markwalters1009@gmail.com which > is folded into this series as the second patch. > > The diff v3+bugfix is below: it does the save-match-data as Austin > suggested, and it removes an accidental added comment which I put in > when finding the bug. > > I have also left off the last "testing patch" (a patch that added some > functionality to make it easier to test the help routine but not > something that should be added to mainline) > > Best wishes > > Mark > > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el > index 20ed1fb..0655bdd 100644 > --- a/emacs/notmuch-lib.el > +++ b/emacs/notmuch-lib.el > @@ -305,16 +305,15 @@ prefix argument. PREFIX and TAIL are used internally." > (defun notmuch-substitute-command-keys (doc) > "Like `substitute-command-keys' but with documentation, not function names." > (let ((beg 0)) > - (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg) ;; matches \{not-space} > + (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg) > (let ((desc > (save-match-data > (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1))) > (keymap (symbol-value (intern keymap-name))) > (ua-keys (where-is-internal 'universal-argument keymap t)) > (desc-alist (notmuch-describe-keymap keymap ua-keys keymap)) > - (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)) > - (desc (mapconcat #'identity desc-list "\n"))) > - desc)))) > + (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))) > + (mapconcat #'identity desc-list "\n"))))) > (setq doc (replace-match desc 1 1 doc))) > (setq beg (match-end 0))) > doc)) > > > > > Mark Walters (7): > emacs: help: check for nil key binding > emacs: help: save-match-data > emacs: help: remove duplicate bindings > emacs: help: split out notmuch-describe-key as a function > emacs: help: add base-keymap > emacs: help: add a special function to deal with remaps > emacs: tree: use remap for the over-ridden global bindings > > emacs/notmuch-lib.el | 85 ++++++++++++++++++++++++++++++++++-------------- > emacs/notmuch-tree.el | 8 ++-- > 2 files changed, 64 insertions(+), 29 deletions(-) >