[PATCH 1/2] emacs: notmuch-help: Integrate into the emacs help system.
Nelson Elhage
nelhage at MIT.EDU
Fri May 14 13:42:06 PDT 2010
Use a *help* buffer like other help commands, and make the [back] and
[forward] links work.
---
emacs/notmuch.el | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 57e1140..6bf8251 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -174,16 +174,14 @@ For a mouse binding, return nil."
(setq beg (match-end 0)))
doc))
-(defun notmuch-help ()
+(defun notmuch-help (&optional mode)
"Display help for the current notmuch mode."
(interactive)
- (let* ((mode major-mode)
- (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))
- (set-buffer-modified-p nil)
- (view-buffer (current-buffer) 'kill-buffer-if-not-modified))))
+ (let ((mode (or mode major-mode)))
+ (help-setup-xref `(notmuch-help ,mode) (interactive-p))
+ (with-help-window (help-buffer)
+ (princ (substitute-command-keys
+ (notmuch-substitute-command-keys (documentation mode t)))))))
(defcustom notmuch-search-hook '(hl-line-mode)
"List of functions to call when notmuch displays the search results."
--
1.6.6.30.g1e6fd
More information about the notmuch
mailing list