--- /dev/null
+Return-Path: <markwalters1009@gmail.com>\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 68DEF431FB6\r
+ for <notmuch@notmuchmail.org>; Mon, 23 Sep 2013 12:53:21 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+ RCVD_IN_DNSWL_LOW=-0.7] 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 ne7fBCma2b-0 for <notmuch@notmuchmail.org>;\r
+ Mon, 23 Sep 2013 12:53:13 -0700 (PDT)\r
+Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com\r
+ [74.125.82.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client\r
+ certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
+ 830A5431FBD for <notmuch@notmuchmail.org>; Mon, 23 Sep 2013 12:53:08 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f51.google.com with SMTP id c11so3491517wgh.18\r
+ for <notmuch@notmuchmail.org>; Mon, 23 Sep 2013 12:53:06 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+ bh=HgxN6x1qQdjHI6qc8bjwEmxrPk7c6RCeqYp/D2R8M7k=;\r
+ b=QpVd0/5XMROzgkUBpGhUa9W5sTO4KmZz7a3fPy0rcbMEho164R5QnYSHIVzvSQisXK\r
+ oSfqyah0znrr2deNiX+3G0WNT87V6LurZ4mVmaJfkZcGk8bVaaGar8A1qD/2NeUbD+0X\r
+ 7mThx1dGirDLmiSITxA/bdNZgI1yHnD/koZ1DSvdVu9IHBY2uAaP/BWvyIZ1hnE8rhlg\r
+ LRy6UruC3Cb3Y8iduE/Z7E7FAAoA2siEVcznXz2OKnn3Av3nsEcx07VLou3vT5wSv7Ea\r
+ B4JHc4mHYRWMJAwVA2yhp5IGHpnh/8GKJ29rVU8oX6bXxCL7KNAL99d+18g5v38t/HEA\r
+ LbWQ==\r
+X-Received: by 10.180.76.171 with SMTP id l11mr14907596wiw.39.1379965985973;\r
+ Mon, 23 Sep 2013 12:53:05 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+ by mx.google.com with ESMTPSA id d11sm722825wic.4.1969.12.31.16.00.00\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Mon, 23 Sep 2013 12:53:05 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] contrib: pick: move M-RET to prefix-arg RET\r
+Date: Mon, 23 Sep 2013 20:52:58 +0100\r
+Message-Id: <1379965979-14752-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1379965979-14752-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1379965979-14752-1-git-send-email-markwalters1009@gmail.com>\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, 23 Sep 2013 19:53:21 -0000\r
+\r
+In pick the user has the option of showing the selected message in a\r
+subpane (the message pane) or in the full frame. This is customisable\r
+using the variable notmuch-pick-show-out. At the moment RET is bound\r
+to the default option and M-RET the other option. This is\r
+messy and involves tricks to make sure the keymap is setup at the\r
+right time.\r
+\r
+This changes this to prefix-arg RET for the other option which\r
+simplifies the code and makes things cleaner.\r
+---\r
+ contrib/notmuch-pick/notmuch-pick.el | 51 +++++++++++++--------------------\r
+ 1 files changed, 20 insertions(+), 31 deletions(-)\r
+\r
+diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+index 054762b..3afdea4 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -50,17 +50,10 @@\r
+ "Showing message and thread structure."\r
+ :group 'notmuch)\r
+ \r
+-;; This is ugly. We can't run setup-show-out until it has been defined\r
+-;; which needs the keymap to be defined. So we defer setting up to\r
+-;; notmuch-pick-init.\r
+ (defcustom notmuch-pick-show-out nil\r
+ "View selected messages in new window rather than split-pane."\r
+ :type 'boolean\r
+- :group 'notmuch-pick\r
+- :set (lambda (symbol value)\r
+- (set-default symbol value)\r
+- (when (fboundp 'notmuch-pick-setup-show-out)\r
+- (notmuch-pick-setup-show-out))))\r
++ :group 'notmuch-pick)\r
+ \r
+ (defcustom notmuch-pick-result-format\r
+ `(("date" . "%12s ")\r
+@@ -241,7 +234,6 @@ FUNC."\r
+ ;; Override because we want to close message pane first.\r
+ (define-key map "m" (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail))\r
+ \r
+- (define-key map [mouse-1] 'notmuch-pick-show-message)\r
+ ;; these use notmuch-show functions directly\r
+ (define-key map "|" 'notmuch-show-pipe-message)\r
+ (define-key map "w" 'notmuch-show-save-attachments)\r
+@@ -261,6 +253,8 @@ FUNC."\r
+ (define-key map "V" (notmuch-pick-close-message-pane-and #'notmuch-show-view-raw-message))\r
+ \r
+ ;; The main pick bindings\r
++ (define-key map (kbd "RET") 'notmuch-pick-show-message)\r
++ (define-key map [mouse-1] 'notmuch-pick-show-message)\r
+ (define-key map "x" 'notmuch-pick-quit)\r
+ (define-key map "A" 'notmuch-pick-archive-thread)\r
+ (define-key map "a" 'notmuch-pick-archive-message-then-next)\r
+@@ -280,21 +274,6 @@ FUNC."\r
+ map))\r
+ (fset 'notmuch-pick-mode-map notmuch-pick-mode-map)\r
+ \r
+-(defun notmuch-pick-setup-show-out ()\r
+- "Set up the keymap for showing a thread\r
+-\r
+-This uses the value of the defcustom notmuch-pick-show-out to\r
+-decide whether to show a message in the message pane or in the\r
+-whole window."\r
+- (let ((map notmuch-pick-mode-map))\r
+- (if notmuch-pick-show-out\r
+- (progn\r
+- (define-key map (kbd "M-RET") 'notmuch-pick-show-message)\r
+- (define-key map (kbd "RET") 'notmuch-pick-show-message-out))\r
+- (progn\r
+- (define-key map (kbd "RET") 'notmuch-pick-show-message)\r
+- (define-key map (kbd "M-RET") 'notmuch-pick-show-message-out)))))\r
+-\r
+ (defun notmuch-pick-get-message-properties ()\r
+ "Return the properties of the current message as a plist.\r
+ \r
+@@ -466,7 +445,7 @@ Does NOT change the database."\r
+ (ignore-errors\r
+ (delete-window notmuch-pick-message-window)))))\r
+ \r
+-(defun notmuch-pick-show-message ()\r
++(defun notmuch-pick-show-message-in ()\r
+ "Show the current message (in split-pane)."\r
+ (interactive)\r
+ (let ((id (notmuch-pick-get-message-id))\r
+@@ -503,6 +482,17 @@ Does NOT change the database."\r
+ (notmuch-pick-close-message-window)\r
+ (notmuch-show id nil nil nil))))\r
+ \r
++(defun notmuch-pick-show-message (arg)\r
++ "Show the current message.\r
++\r
++Shows in split pane or whole window according to value of\r
++`notmuch-pick-show-out'. A prefix argument reverses the choice."\r
++ (interactive "P")\r
++ (if (or (and notmuch-pick-show-out (not arg))\r
++ (and (not notmuch-pick-show-out) arg))\r
++ (notmuch-pick-show-message-out)\r
++ (notmuch-pick-show-message-in)))\r
++\r
+ (defun notmuch-pick-scroll-message-window ()\r
+ "Scroll the message window (if it exists)"\r
+ (interactive)\r
+@@ -566,14 +556,14 @@ message will be \"unarchived\", i.e. the tag changes in\r
+ (interactive)\r
+ (forward-line)\r
+ (when (window-live-p notmuch-pick-message-window)\r
+- (notmuch-pick-show-message)))\r
++ (notmuch-pick-show-message-in)))\r
+ \r
+ (defun notmuch-pick-prev-message ()\r
+ "Move to previous message."\r
+ (interactive)\r
+ (forward-line -1)\r
+ (when (window-live-p notmuch-pick-message-window)\r
+- (notmuch-pick-show-message)))\r
++ (notmuch-pick-show-message-in)))\r
+ \r
+ (defun notmuch-pick-prev-matching-message ()\r
+ "Move to previous matching message."\r
+@@ -582,7 +572,7 @@ message will be \"unarchived\", i.e. the tag changes in\r
+ (while (and (not (bobp)) (not (notmuch-pick-get-match)))\r
+ (forward-line -1))\r
+ (when (window-live-p notmuch-pick-message-window)\r
+- (notmuch-pick-show-message)))\r
++ (notmuch-pick-show-message-in)))\r
+ \r
+ (defun notmuch-pick-next-matching-message ()\r
+ "Move to next matching message."\r
+@@ -591,7 +581,7 @@ message will be \"unarchived\", i.e. the tag changes in\r
+ (while (and (not (eobp)) (not (notmuch-pick-get-match)))\r
+ (forward-line))\r
+ (when (window-live-p notmuch-pick-message-window)\r
+- (notmuch-pick-show-message)))\r
++ (notmuch-pick-show-message-in)))\r
+ \r
+ (defun notmuch-pick-refresh-view ()\r
+ "Refresh view."\r
+@@ -763,7 +753,7 @@ unchanged ADDRESS if parsing fails."\r
+ (goto-char (point-max))\r
+ (forward-line -1)\r
+ (when notmuch-pick-open-target\r
+- (notmuch-pick-show-message)))))\r
++ (notmuch-pick-show-message-in)))))\r
+ \r
+ (defun notmuch-pick-insert-tree (tree depth tree-status first last)\r
+ "Insert the message tree TREE at depth DEPTH in the current thread.\r
+@@ -952,7 +942,6 @@ The arguments are:\r
+ (define-key notmuch-search-mode-map "Z" 'notmuch-pick-from-search-current-query)\r
+ (define-key notmuch-search-mode-map (kbd "M-RET") 'notmuch-pick-from-search-thread)\r
+ (define-key notmuch-show-mode-map "Z" 'notmuch-pick-from-show-current-query)\r
+-(notmuch-pick-setup-show-out)\r
+ (message "Initialised notmuch-pick")\r
+ \r
+ (provide 'notmuch-pick)\r
+-- \r
+1.7.9.1\r
+\r