[PATCH] emacs: help: add link to info node

Subject: [PATCH] emacs: help: add link to info node

Date: Sat, 18 Jan 2014 14:52:53 +0000

To: notmuch@notmuchmail.org

Cc:

From: Mark Walters


Add a link to the info documentation from the keybindings help page.
---

For anyone who wants to try this out. (Only works in hello and search
mode while there are no other info nodes).

Best wishes

Mark



 emacs/notmuch-lib.el |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 2be409b..228680b 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -331,10 +331,18 @@ its prefixed behavior by setting the 'notmuch-prefix-doc property
 of its command symbol."
   (interactive)
   (let* ((mode major-mode)
+	 (parent-mode-name mode-name)
+	 (info-node (concat "(notmuch-emacs)" mode-name))
 	 (doc (substitute-command-keys (notmuch-substitute-command-keys (documentation mode t)))))
     (with-current-buffer (generate-new-buffer "*notmuch-help*")
       (insert doc)
       (goto-char (point-min))
+      (forward-line 2)
+      (insert-button (concat "Info documentation for " parent-mode-name ".")
+		     'action `(lambda (x) (info ,info-node)))
+      (insert "\n\n")
+      (goto-char (point-min))
+      (forward-button 1)
       (set-buffer-modified-p nil)
       (view-buffer (current-buffer) 'kill-buffer-if-not-modified))))
 
-- 
1.7.9.1


Thread: