[PATCH v4 0/7] emacs: help: remap keybindings
authorMark Walters <markwalters1009@gmail.com>
Tue, 12 Nov 2013 20:10:52 +0000 (20:10 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:58:12 +0000 (09:58 -0800)
02/e2665f46ecf183f0fca5a7a9fde734bfcd84aa [new file with mode: 0644]

diff --git a/02/e2665f46ecf183f0fca5a7a9fde734bfcd84aa b/02/e2665f46ecf183f0fca5a7a9fde734bfcd84aa
new file mode 100644 (file)
index 0000000..bede277
--- /dev/null
@@ -0,0 +1,124 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 16CC1431FD7\r
+       for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:16:40 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.7\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.7 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id oHgV7m3xzVDR for <notmuch@notmuchmail.org>;\r
+       Tue, 12 Nov 2013 12:16:32 -0800 (PST)\r
+Received: from mail-we0-f171.google.com (mail-we0-f171.google.com\r
+       [74.125.82.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 8FE6D431FCF\r
+       for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:16:32 -0800 (PST)\r
+Received: by mail-we0-f171.google.com with SMTP id t61so3228896wes.30\r
+       for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:16:27 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id;\r
+       bh=myvFFB2RpJ8MsIO9Kja+GUxb0h+8EyOZoz38NkJ7lVI=;\r
+       b=ozzpL0Iy+ixjbAANUMPEPOR/0m8z18gMxTglKjzHPW7ycC+I+L0x81aRXr0nfqif0E\r
+       9uIs2qyJc+9POaWGZH8MX0AHAmrV1K4CYuB4faDygT4x8HlywUJSYwuA1D+ZXfy9db4M\r
+       gdMiYP3J38BiALbpE0Jsch4JTCbxBWB7SUydPvYFCkc6kH8Br6ZTEjj+LPXiMJHU4wvw\r
+       eBfOejU/w9ScY1E5bpjiPvkd8aTAn9a/iIPTH797d2hAR6XguDcqvLm/t2Vr6/cm19nP\r
+       AS8smy5LSq+AIVTX9+jiUBQyBIbigvwqdvinDugnrOMckjDiaHRCHi3HNctksPT8vp4b\r
+       5Vkg==\r
+X-Received: by 10.180.37.227 with SMTP id b3mr17740337wik.24.1384287065082;\r
+       Tue, 12 Nov 2013 12:11:05 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id\r
+       ft19sm47895052wic.5.2013.11.12.12.11.03 for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Tue, 12 Nov 2013 12:11:04 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 0/7] emacs: help: remap keybindings\r
+Date: Tue, 12 Nov 2013 20:10:52 +0000\r
+Message-Id: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 12 Nov 2013 20:16:40 -0000\r
+\r
+This is v4 of this patch set. v3 is at id:1383932419-12533-1-git-send-email-markwalters1009@gmail.com.\r
+\r
+David found a bug in v3 which I tracked down to some match-data being\r
+over-written. This included the bugfix\r
+id:1384076682-16872-1-git-send-email-markwalters1009@gmail.com which\r
+is folded into this series as the second patch.\r
+\r
+The diff v3+bugfix is below: it does the save-match-data as Austin\r
+suggested, and it removes an accidental added comment which I put in\r
+when finding the bug.\r
+\r
+I have also left off the last "testing patch" (a patch that added some\r
+functionality to make it easier to test the help routine but not\r
+something that should be added to mainline)\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 20ed1fb..0655bdd 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -305,16 +305,15 @@ prefix argument.  PREFIX and TAIL are used internally."\r
+ (defun notmuch-substitute-command-keys (doc)\r
+   "Like `substitute-command-keys' but with documentation, not function names."\r
+   (let ((beg 0))\r
+-    (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg) ;; matches \{not-space}\r
++    (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg)\r
+       (let ((desc\r
+            (save-match-data\r
+              (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))\r
+                     (keymap (symbol-value (intern keymap-name)))\r
+                     (ua-keys (where-is-internal 'universal-argument keymap t))\r
+                     (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))\r
+-                    (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))\r
+-                    (desc (mapconcat #'identity desc-list "\n")))\r
+-               desc))))\r
++                    (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)))\r
++               (mapconcat #'identity desc-list "\n")))))\r
+       (setq doc (replace-match desc 1 1 doc)))\r
+       (setq beg (match-end 0)))\r
+     doc))\r
+\r
+\r
+\r
+\r
+Mark Walters (7):\r
+  emacs: help: check for nil key binding\r
+  emacs: help: save-match-data\r
+  emacs: help: remove duplicate bindings\r
+  emacs: help: split out notmuch-describe-key as a function\r
+  emacs: help: add base-keymap\r
+  emacs: help: add a special function to deal with remaps\r
+  emacs: tree: use remap for the over-ridden global bindings\r
+\r
+ emacs/notmuch-lib.el  |   85 ++++++++++++++++++++++++++++++++++--------------\r
+ emacs/notmuch-tree.el |    8 ++--\r
+ 2 files changed, 64 insertions(+), 29 deletions(-)\r
+\r
+-- \r
+1.7.9.1\r
+\r