[PATCH 1/2] contrib: pick: remove hack notmuch-pick-show-match-message-with-wait
authorMark Walters <markwalters1009@gmail.com>
Sun, 26 May 2013 06:50:07 +0000 (07:50 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:55:01 +0000 (09:55 -0800)
c0/0e0837ca84fcc230dd82253b4bb2adfbfc04e4 [new file with mode: 0644]

diff --git a/c0/0e0837ca84fcc230dd82253b4bb2adfbfc04e4 b/c0/0e0837ca84fcc230dd82253b4bb2adfbfc04e4
new file mode 100644 (file)
index 0000000..ad5bb9a
--- /dev/null
@@ -0,0 +1,171 @@
+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 4755E431FC7\r
+       for <notmuch@notmuchmail.org>; Sat, 25 May 2013 23:50:23 -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 VTKI+Q-48sbt for <notmuch@notmuchmail.org>;\r
+       Sat, 25 May 2013 23:50:16 -0700 (PDT)\r
+Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com\r
+       [209.85.212.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 7C58F431FAF\r
+       for <notmuch@notmuchmail.org>; Sat, 25 May 2013 23:50:16 -0700 (PDT)\r
+Received: by mail-wi0-f182.google.com with SMTP id c10so724774wiw.15\r
+       for <notmuch@notmuchmail.org>; Sat, 25 May 2013 23:50:15 -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:x-mailer:in-reply-to:references;\r
+       bh=rLOnFyJmbgSQ25Qqq7hucdxQbYEMH6nuxHVoSjrflMU=;\r
+       b=lxfyBvHFcyb/NOPTvWnRqX6Uhm4M/fOVk6NdLVioGnxteB+tR0IzQHC6ckMlq3ZyqS\r
+       vhtHoBSoWiUtOa53hRAUsV/9kSjfVDCAxTG9gVCEPCEVhCJSQvVmV8yRSsXtWTT3+4aa\r
+       Ds+JQLcc4XfhB0OIcLUvhZ2S+ZP8I7W5FT6ANouYgH4STBGYIQi0qgn4ndxUkh0xDcdo\r
+       0gsC/p3uireLRXN6fgIcPqnWd3EmTX/9eaiuksJOTH10PpEeBeGR+UI4uELgeOMHsGrX\r
+       I8nlKgAXHlYG++5+07aMNzxYjMDqAw0RNp1qDeTNV35j/ZmSUyAFwI2LjFd86I2GYbpl\r
+       Fqmg==\r
+X-Received: by 10.180.188.141 with SMTP id ga13mr4131817wic.9.1369551015442;\r
+       Sat, 25 May 2013 23:50:15 -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 q20sm9057223wiv.7.2013.05.25.23.50.14\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sat, 25 May 2013 23:50:14 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] contrib: pick: remove hack\r
+       notmuch-pick-show-match-message-with-wait\r
+Date: Sun, 26 May 2013 07:50:07 +0100\r
+Message-Id: <1369551008-30697-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1369551008-30697-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1369551008-30697-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: Sun, 26 May 2013 06:50:23 -0000\r
+\r
+This function was a horrible hack (sleeping while waiting for the\r
+correct message). The new target code can just open the message in the\r
+message window when it arrives.\r
+---\r
+ contrib/notmuch-pick/notmuch-pick.el |   37 +++++++++++-----------------------\r
+ 1 files changed, 12 insertions(+), 25 deletions(-)\r
+\r
+diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+index b7e9515..9112989 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -157,6 +157,8 @@\r
+ (make-variable-buffer-local 'notmuch-pick-query-context)\r
+ (defvar notmuch-pick-target-msg nil)\r
+ (make-variable-buffer-local 'notmuch-pick-target-msg)\r
++(defvar notmuch-pick-open-target nil)\r
++(make-variable-buffer-local 'notmuch-pick-open-target)\r
+ (defvar notmuch-pick-buffer-name nil)\r
+ (make-variable-buffer-local 'notmuch-pick-buffer-name)\r
+ ;; This variable is the window used for the message pane. It is set\r
+@@ -349,8 +351,8 @@ Does NOT change the database."\r
+   (notmuch-pick (notmuch-search-find-thread-id)\r
+                 notmuch-search-query-string\r
+               nil\r
+-                (notmuch-prettify-subject (notmuch-search-find-subject)))\r
+-  (notmuch-pick-show-match-message-with-wait))\r
++                (notmuch-prettify-subject (notmuch-search-find-subject))\r
++              t))\r
\r
+ (defun notmuch-pick-message-window-kill-hook ()\r
+   (let ((buffer (current-buffer)))\r
+@@ -489,22 +491,6 @@ will be reversed."\r
+   (when (window-live-p notmuch-pick-message-window)\r
+     (notmuch-pick-show-message)))\r
\r
+-(defun notmuch-pick-show-match-message-with-wait ()\r
+-  "Show the first matching message but wait for it to appear or search to finish."\r
+-  (interactive)\r
+-  (unless (notmuch-pick-get-match)\r
+-    (notmuch-pick-next-matching-message))\r
+-  (while (and (not (notmuch-pick-get-match))\r
+-            (get-buffer-process (current-buffer)))\r
+-    (message "waiting for message")\r
+-    (sit-for 0.1)\r
+-    (goto-char (point-min))\r
+-    (unless (notmuch-pick-get-match)\r
+-      (notmuch-pick-next-matching-message)))\r
+-  (message nil)\r
+-  (when (notmuch-pick-get-match)\r
+-    (notmuch-pick-show-message)))\r
+-\r
+ (defun notmuch-pick-refresh-view ()\r
+   "Refresh view."\r
+   (interactive)\r
+@@ -658,7 +644,9 @@ unchanged ADDRESS if parsing fails."\r
+             (string= msg-id target))\r
+       (setq notmuch-pick-target-msg "found")\r
+       (goto-char (point-max))\r
+-      (forward-line -1))))\r
++      (forward-line -1)\r
++      (when notmuch-pick-open-target\r
++      (notmuch-pick-show-message)))))\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
+@@ -779,13 +767,14 @@ Complete list of currently available key bindings:\r
+                                        'notmuch-pick-show-error\r
+                                        results-buf)))))\r
\r
+-(defun notmuch-pick-worker (basic-query &optional query-context target buffer)\r
++(defun notmuch-pick-worker (basic-query &optional query-context target buffer open-target)\r
+   (interactive)\r
+   (notmuch-pick-mode)\r
+   (setq notmuch-pick-basic-query basic-query)\r
+   (setq notmuch-pick-query-context query-context)\r
+   (setq notmuch-pick-buffer-name (buffer-name buffer))\r
+   (setq notmuch-pick-target-msg target)\r
++  (setq notmuch-pick-open-target open-target)\r
\r
+   (erase-buffer)\r
+   (goto-char (point-min))\r
+@@ -817,7 +806,7 @@ Complete list of currently available key bindings:\r
+         (insert "End of search results.\n"))))))\r
\r
\r
+-(defun notmuch-pick (&optional query query-context target buffer-name show-first-match)\r
++(defun notmuch-pick (&optional query query-context target buffer-name open-target)\r
+   "Run notmuch pick with the given `query' and display the results"\r
+   (interactive "sNotmuch pick: ")\r
+   (if (null query)\r
+@@ -831,11 +820,9 @@ Complete list of currently available key bindings:\r
+     ;; Don't track undo information for this buffer\r
+     (set 'buffer-undo-list t)\r
\r
+-    (notmuch-pick-worker query query-context target buffer)\r
++    (notmuch-pick-worker query query-context target buffer open-target)\r
\r
+-    (setq truncate-lines t)\r
+-    (when show-first-match\r
+-      (notmuch-pick-show-match-message-with-wait))))\r
++    (setq truncate-lines t)))\r
\r
\r
+ ;; Set up key bindings from the rest of notmuch.\r
+-- \r
+1.7.9.1\r
+\r