[PATCH v3 7/7] emacs: help: base-keymap-test-help

Mark Walters markwalters1009 at gmail.com
Fri Nov 8 09:40:19 PST 2013


Add an argument to notmuch-help for the mode to display help for.
This aids testing of the base-keymap case in remapping in emacs help.

It is only intended for testing, ie not for master (but it does no harm)
---
 emacs/notmuch-lib.el |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 4b3a86e..7b8acb3 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -316,7 +316,7 @@ prefix argument.  PREFIX and TAIL are used internally."
       (setq beg (match-end 0)))
     doc))
 
-(defun notmuch-help ()
+(defun notmuch-help (&optional mode)
   "Display help for the current notmuch mode.
 
 This is similar to `describe-function' for the current major
@@ -328,7 +328,7 @@ A command that supports a prefix argument can explicitly document
 its prefixed behavior by setting the 'notmuch-prefix-doc property
 of its command symbol."
   (interactive)
-  (let* ((mode major-mode)
+  (let* ((mode (or mode major-mode))
 	 (doc (substitute-command-keys (notmuch-substitute-command-keys (documentation mode t)))))
     (with-current-buffer (generate-new-buffer "*notmuch-help*")
       (insert doc)
-- 
1.7.9.1



More information about the notmuch mailing list