[PATCH v2 2/3] contrib: pick: remove hack notmuch-pick-show-match-message-with-wait
authorMark Walters <markwalters1009@gmail.com>
Sun, 30 Jun 2013 08:55:11 +0000 (09:55 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:55:46 +0000 (09:55 -0800)
ab/8e1d9fc83f2083384ff62564ce75b904a735af [new file with mode: 0644]

diff --git a/ab/8e1d9fc83f2083384ff62564ce75b904a735af b/ab/8e1d9fc83f2083384ff62564ce75b904a735af
new file mode 100644 (file)
index 0000000..964070d
--- /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 12E09431FD4\r
+       for <notmuch@notmuchmail.org>; Sun, 30 Jun 2013 01:55:31 -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 P2ArrPPUci2D for <notmuch@notmuchmail.org>;\r
+       Sun, 30 Jun 2013 01:55:24 -0700 (PDT)\r
+Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com\r
+ [74.125.82.46])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ F3CEF431FBD   for <notmuch@notmuchmail.org>; Sun, 30 Jun 2013 01:55:20 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f46.google.com with SMTP id c11so2837110wgh.1\r
+       for <notmuch@notmuchmail.org>; Sun, 30 Jun 2013 01:55:19 -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=XzJaoAhElxwtShCfEiBQOzCEn0t/I9eQ6eGGSkiLjsU=;\r
+       b=xcgiMIiev4mAUy2f7PCEhUvXk80SRXOWBPeGWUg7Gy4CNaDaoko0Z9ekKW3F/6q0SY\r
+       Zbp1VD+vGLVSH/NuUBR3uR7WhAcJ6cwCcYG0OZJGwsT06aWAZ6V2/TWUs2hxh7a6zld+\r
+       HYlbvz8z1hIB00g8rBomN9EFt8TzEMD3EhiOcOi5nQbPqczduOE93C/kBOShc7x8pQ9f\r
+       mQUa1fDTl+lgvYFD1bHBpVl21mD4ivWZDAt9+VUaJ5ZaTaz9fXIkSD5bjqHixDcRYIsF\r
+       YFhfJ1DKxtw89p4qh78mkxWV6BsS4AL3HvbDxxfQmfIu0GLDy8REESGqKsgbT4GBGRtv\r
+       IfBA==\r
+X-Received: by 10.194.8.163 with SMTP id s3mr17062287wja.41.1372582519924;\r
+       Sun, 30 Jun 2013 01:55:19 -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 fb9sm8604021wid.2.2013.06.30.01.55.18\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sun, 30 Jun 2013 01:55:19 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 2/3] contrib: pick: remove hack\r
+       notmuch-pick-show-match-message-with-wait\r
+Date: Sun, 30 Jun 2013 09:55:11 +0100\r
+Message-Id: <1372582512-10777-3-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1372582512-10777-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1372582512-10777-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, 30 Jun 2013 08:55:31 -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 ef16ca7..5639c7c 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 @@ message will be \"unarchived\", i.e. the tag changes in\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
+@@ -778,13 +766,14 @@ Complete list of currently available key bindings:\r
+       (notmuch-sexp-parse-partial-list 'notmuch-pick-insert-forest-thread\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
+@@ -816,7 +805,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
+@@ -830,11 +819,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