--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\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 4D132431FBC\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Oct 2013 13:14:29 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 84BzyTUCfjsZ for <notmuch@notmuchmail.org>;\r
+ Sun, 6 Oct 2013 13:14:23 -0700 (PDT)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 0A5EA431FAF\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Oct 2013 13:14:23 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1VSuiM-0000fE-Ln; Sun, 06 Oct 2013 21:14:09 +0100\r
+Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1VSuiM-0007C9-AE; Sun, 06 Oct 2013 21:14:06 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 4/6] emacs: Support overriding help and describing prefix\r
+ action\r
+In-Reply-To: <1381029768-11883-5-git-send-email-amdragon@mit.edu>\r
+References: <1381029768-11883-1-git-send-email-amdragon@mit.edu>\r
+ <1381029768-11883-5-git-send-email-amdragon@mit.edu>\r
+User-Agent: Notmuch/0.16 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 06 Oct 2013 21:14:04 +0100\r
+Message-ID: <87wqlqqhrn.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-Sender-Host-Address: 93.97.24.31\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 4b1b0e1d5fb09106fd36f4b71bfaeb7a (of first 20000 bytes)\r
+X-SpamAssassin-Score: 0.0\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored 0.0 points. Summary of the scoring: \r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * 0.0 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\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: Sun, 06 Oct 2013 20:14:29 -0000\r
+\r
+\r
+This whole series looks good to me. If you are rolling another version\r
+for any reason I have one trivial comment\r
+\r
+On Sun, 06 Oct 2013, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> Traditionally, function documentation strings are intended primarily\r
+> for programmers, rather than users. They're written from the\r
+> perspective of calling the function, not interactively invoking it.\r
+> They're only ever displayed along with the function prototype (and\r
+> often refer to argument names). And built-in help commands like\r
+> `describe-bindings' show the name of the command, not its\r
+> documentation.\r
+>\r
+> The notmuch help system is like `describe-bindings', but tries to be\r
+> more user-friendly by displaying documentation strings, rather than\r
+> Elisp command names. For most commands, this is fine, but for some\r
+> the "programmer description" is inappropriate for interactive use.\r
+> This is particularly noticeable for commands that take an optional\r
+> prefix argument.\r
+>\r
+> This patch adds support for two symbol properties: notmuch-doc and\r
+> notmuch-prefix-doc, which let a command override its interactive\r
+> documentation and provide separate documentation for its prefixed\r
+> invocation. If notmuch-prefix-doc is present, we add an extra line to\r
+> the help giving the prefixed key sequence along with the documentation\r
+> for the prefixed command.\r
+> ---\r
+> emacs/notmuch.el | 29 ++++++++++++++++++++++++-----\r
+> 1 file changed, 24 insertions(+), 5 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index a36849f..278bd35 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -140,7 +140,7 @@ This is basically just `format-kbd-macro' but we also convert ESC to M-."\r
+> "M-"\r
+> (concat desc " "))))\r
+> \r
+> -(defun notmuch-describe-keymap (keymap &optional prefix tail)\r
+> +(defun notmuch-describe-keymap (keymap ua-keys &optional prefix tail)\r
+> "Return a list of strings, each describing one key in KEYMAP.\r
+> \r
+> Each string gives a human-readable description of the key and the\r
+\r
+It would be nice to document the ua-keys variable here. It took me some\r
+time to work out what was going in (and I worked out based on the\r
+caller).\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+> @@ -151,10 +151,19 @@ first line of documentation for the bound function."\r
+> ((keymapp binding)\r
+> (setq tail\r
+> (notmuch-describe-keymap\r
+> - binding (notmuch-prefix-key-description key) tail)))\r
+> + binding ua-keys (notmuch-prefix-key-description key) tail)))\r
+> (t\r
+> + (when (and ua-keys (symbolp binding)\r
+> + (get binding 'notmuch-prefix-doc))\r
+> + ;; Documentation for prefixed command\r
+> + (let ((ua-desc (key-description ua-keys)))\r
+> + (push (concat ua-desc " " prefix (format-kbd-macro (vector key))\r
+> + "\t" (get binding 'notmuch-prefix-doc))\r
+> + tail)))\r
+> + ;; Documentation for command\r
+> (push (concat prefix (format-kbd-macro (vector key)) "\t"\r
+> - (notmuch-documentation-first-line binding))\r
+> + (or (and (symbolp binding) (get binding 'notmuch-doc))\r
+> + (notmuch-documentation-first-line binding)))\r
+> tail))))\r
+> keymap)\r
+> tail)\r
+> @@ -165,14 +174,24 @@ first line of documentation for the bound function."\r
+> (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg)\r
+> (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))\r
+> (keymap (symbol-value (intern keymap-name)))\r
+> - (desc-list (notmuch-describe-keymap keymap))\r
+> + (ua-keys (where-is-internal 'universal-argument keymap t))\r
+> + (desc-list (notmuch-describe-keymap keymap ua-keys))\r
+> (desc (mapconcat #'identity desc-list "\n")))\r
+> (setq doc (replace-match desc 1 1 doc)))\r
+> (setq beg (match-end 0)))\r
+> doc))\r
+> \r
+> (defun notmuch-help ()\r
+> - "Display help for the current notmuch mode."\r
+> + "Display help for the current notmuch mode.\r
+> +\r
+> +This is similar to `describe-function' for the current major\r
+> +mode, but bindings tables are shown with documentation strings\r
+> +rather than command names. By default, this uses the first line\r
+> +of each command's documentation string. A command can override\r
+> +this by setting the 'notmuch-doc property of its command symbol.\r
+> +A command that supports a prefix argument can explicitly document\r
+> +its prefixed behavior by setting the 'notmuch-prefix-doc property\r
+> +of its command symbol."\r
+> (interactive)\r
+> (let* ((mode major-mode)\r
+> (doc (substitute-command-keys (notmuch-substitute-command-keys (documentation mode t)))))\r
+> -- \r
+> 1.8.4.rc3\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r