--- /dev/null
+Return-Path: <too@guru-group.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 53A1F431FDC\r
+ for <notmuch@notmuchmail.org>; Sat, 24 Aug 2013 05:15:52 -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 LMpZu7ARJJoJ for <notmuch@notmuchmail.org>;\r
+ Sat, 24 Aug 2013 05:15:47 -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 76981431FBD\r
+ for <notmuch@notmuchmail.org>; Sat, 24 Aug 2013 05:15:47 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 9C67410009D; Sat, 24 Aug 2013 15:15:41 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] emacs: add '?' to some prefix keymaps to describe its\r
+ bindings\r
+Date: Sat, 24 Aug 2013 15:15:40 +0300\r
+Message-Id: <1377346540-7094-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+Cc: tomi.ollila@iki.fi\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: Sat, 24 Aug 2013 12:15:52 -0000\r
+\r
+Added (private) function `notmuch--prefix-bindings' which wraps\r
+`describe-prefix-bindings' to provide more suitable user interface for\r
+showing the key sequences that follow a particular notmuch prefix\r
+keymap invocation.\r
+\r
+The key '?' in prefix keymaps `notmuch-search-stash-map',\r
+`notmuch-show-stash-map' and `notmuch-show-part-map' is bound to this\r
+function via `lambda' expression. By using this lambda expression the\r
+pop-up binding description window shows '??' instead of\r
+`notmuch--prefix-bindings' for the binding of '?' -- which suits our\r
+needs perfectly.\r
+---\r
+ emacs/notmuch-lib.el | 9 +++++++++\r
+ emacs/notmuch-show.el | 2 ++\r
+ emacs/notmuch.el | 1 +\r
+ 3 files changed, 12 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 4796f17..8191aec 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -553,6 +553,15 @@ status."\r
+ (message "%s" (error-message-string err))))\r
+ (ignore-errors (delete-file err-file))))\r
+ \r
++(defun notmuch--prefix-bindings ()\r
++ "Notmuch private wrapper for `describe-prefix-bindings'."\r
++ ;;(interactive)\r
++ (describe-prefix-bindings)\r
++ (pop-to-buffer "*Help*") ; XXX that's what describe-bindings-internal uses\r
++ (let ((buffer-read-only nil))\r
++ (goto-char (point-min))\r
++ (insert "\nPress 'q' to quit this window.\n\n")))\r
++\r
+ ;; This variable is used only buffer local, but it needs to be\r
+ ;; declared globally first to avoid compiler warnings.\r
+ (defvar notmuch-show-process-crypto nil)\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 82b70ba..98bf3d4 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1248,6 +1248,7 @@ reset based on the original query."\r
+ (define-key map "t" 'notmuch-show-stash-to)\r
+ (define-key map "l" 'notmuch-show-stash-mlarchive-link)\r
+ (define-key map "L" 'notmuch-show-stash-mlarchive-link-and-go)\r
++ (define-key map "?" (lambda () (interactive) (notmuch--prefix-bindings)))\r
+ map)\r
+ "Submap for stash commands")\r
+ (fset 'notmuch-show-stash-map notmuch-show-stash-map)\r
+@@ -1258,6 +1259,7 @@ reset based on the original query."\r
+ (define-key map "v" 'notmuch-show-view-part)\r
+ (define-key map "o" 'notmuch-show-interactively-view-part)\r
+ (define-key map "|" 'notmuch-show-pipe-part)\r
++ (define-key map "?" (lambda () (interactive) (notmuch--prefix-bindings)))\r
+ map)\r
+ "Submap for part commands")\r
+ (fset 'notmuch-show-part-map notmuch-show-part-map)\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index f3ce840..3a115c8 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -245,6 +245,7 @@ For a mouse binding, return nil."\r
+ (defvar notmuch-search-stash-map\r
+ (let ((map (make-sparse-keymap)))\r
+ (define-key map "i" 'notmuch-search-stash-thread-id)\r
++ (define-key map "?" (lambda () (interactive) (notmuch--prefix-bindings)))\r
+ map)\r
+ "Submap for stash commands")\r
+ (fset 'notmuch-search-stash-map notmuch-search-stash-map)\r
+-- \r
+1.8.0\r
+\r