--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 56F6C431FAF\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Oct 2013 22:54:53 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ 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 TOZtoTNG6zQJ for <notmuch@notmuchmail.org>;\r
+ Sun, 6 Oct 2013 22:54:46 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 7C8BA431FAE\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Oct 2013 22:54:46 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 9B735100030;\r
+ Mon, 7 Oct 2013 08:54:38 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Mark Walters <markwalters1009@gmail.com>,\r
+ 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: <87wqlqqhrn.fsf@qmul.ac.uk>\r
+References: <1381029768-11883-1-git-send-email-amdragon@mit.edu>\r
+ <1381029768-11883-5-git-send-email-amdragon@mit.edu>\r
+ <87wqlqqhrn.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.16+87~g451fefe (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Mon, 07 Oct 2013 08:54:37 +0300\r
+Message-ID: <m2wqlpiq1u.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Mon, 07 Oct 2013 05:54:53 -0000\r
+\r
+On Sun, Oct 06 2013, Mark Walters <markwalters1009@gmail.com> wrote:\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
+This series Looks Good To Me, too.\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
+I did not have any problems understanding this -- probably due to me\r
+having played so much with where-is-internal and such commands...\r
+... just that this looks to me as 'first-ua-key' (ua being unversal \r
+argument, not user agent ;)\r
+\r
+If there is need for new version then documenting this would not hurt...\r
+if not followup-patch to add this documentation (w/ one line commit\r
+message for least review effort! ;) could do)\r
+\r
+Tomi\r
+\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
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r