From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 43CF5418C3C for ; Fri, 14 May 2010 13:42:29 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham 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 sGs8mbNo-urb for ; Fri, 14 May 2010 13:42:17 -0700 (PDT) Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU [18.9.25.14]) by olra.theworths.org (Postfix) with ESMTP id 417B14196F4 for ; Fri, 14 May 2010 13:42:17 -0700 (PDT) X-AuditID: 1209190e-b7b82ae000005260-2e-4bedb5a8b93b Received: from mailhub-auth-3.mit.edu (MAILHUB-AUTH-3.MIT.EDU [18.9.21.43]) by dmz-mailsec-scanner-3.mit.edu (Symantec Brightmail Gateway) with SMTP id 6A.7A.21088.8A5BDEB4; Fri, 14 May 2010 16:42:16 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id o4EKgGnV012898; Fri, 14 May 2010 16:42:16 -0400 Received: from PHANATIQUE.MIT.EDU (c-71-192-160-118.hsd1.nh.comcast.net [71.192.160.118]) (authenticated bits=0) (User authenticated as nelhage@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id o4EKgFnD007726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 14 May 2010 16:42:16 -0400 (EDT) From: Nelson Elhage To: notmuch@notmuchmail.org Subject: [PATCH 1/2] emacs: notmuch-help: Integrate into the emacs help system. Date: Fri, 14 May 2010 16:42:06 -0400 Message-Id: <1273869727-32740-2-git-send-email-nelhage@mit.edu> X-Mailer: git-send-email 1.6.6.30.g1e6fd In-Reply-To: <1273869727-32740-1-git-send-email-nelhage@mit.edu> References: <1273869727-32740-1-git-send-email-nelhage@mit.edu> X-Brightmail-Tracker: AAAAARQpM2I= 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: Fri, 14 May 2010 20:42:29 -0000 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