[PATCH 1/5] emacs: move tag.el utility functions from lists to strings
authorMark Walters <markwalters1009@gmail.com>
Fri, 30 Nov 2012 08:21:27 +0000 (08:21 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:11 +0000 (09:51 -0800)
a4/0c156eb36ed7c542c95810a200bec9c12b761b [new file with mode: 0644]

diff --git a/a4/0c156eb36ed7c542c95810a200bec9c12b761b b/a4/0c156eb36ed7c542c95810a200bec9c12b761b
new file mode 100644 (file)
index 0000000..6857068
--- /dev/null
@@ -0,0 +1,116 @@
+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 9CE58431FBC\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:23:19 -0800 (PST)\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 Y9P6zR9UJJn0 for <notmuch@notmuchmail.org>;\r
+       Fri, 30 Nov 2012 00:23:19 -0800 (PST)\r
+Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com\r
+ [74.125.82.41])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 08DCD431FAF   for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:23:18 -0800\r
+ (PST)\r
+Received: by mail-wg0-f41.google.com with SMTP id ds1so4340809wgb.2\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:23:17 -0800 (PST)\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=GE+siC9KJnmiPylUu9WuR6TIRmrpgoCRJFhx0RwrNP4=;\r
+       b=waYPWb0ay63VhHLdMjybuQBmwTxP+kK2gfjt5dfoamNdf9A52hZe9nETInftRgCCFR\r
+       adVaLH9lkvI1GpvgDnlvnCNG3PY3ccgfErRGGDX8lLTACweT+7wPGSxrokAJOqU1QSzQ\r
+       1FnBaPPMeRQWaQQw8Typ5Y5ciLFlnoDaDA304dPbudk4Ky5dSrg94MzFZq+rJuVxEWdV\r
+       afebV9Loe6cAWys6hW1pSI3X5uKmAw44J5NL39jzoPWS9p9vysT0V2CQG6PjZaBEcUyj\r
+       k2bvFUd234SlN/uLKazJWMSgb95hfHJQ/4DzAqImVDy8wxeGuHpy7xY6B0oqg5B7qWjV\r
+       DA5A==\r
+Received: by 10.180.92.166 with SMTP id cn6mr661355wib.19.1354263797907;\r
+       Fri, 30 Nov 2012 00:23:17 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id g2sm5953472wiy.0.2012.11.30.00.23.16\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 30 Nov 2012 00:23:17 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/5] emacs: move tag.el utility functions from lists to\r
+ strings\r
+Date: Fri, 30 Nov 2012 08:21:27 +0000\r
+Message-Id: <1354263691-19715-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1354263691-19715-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1354263691-19715-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: Fri, 30 Nov 2012 08:23:19 -0000\r
+\r
+From: markwalters1009 <markwalters1009@gmail.com>\r
+\r
+The query for most of the notmuch-tag.el utility functions was a list\r
+(or multiple arguments) (but not for the main calling point:\r
+notmuch-tag). This patch moves them all to take the query as a string\r
+instead. This makes it easier to add extra parameters in the next\r
+patch.\r
+---\r
+ emacs/notmuch-tag.el |   16 ++++++++--------\r
+ 1 files changed, 8 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
+index 4fce3a9..1f3d8cf 100644\r
+--- a/emacs/notmuch-tag.el\r
++++ b/emacs/notmuch-tag.el\r
+@@ -55,26 +55,26 @@ the messages that were tagged"\r
+ `notmuch-read-tag-changes' function.")\r
+ \r
+ (defun notmuch-tag-completions (&optional search-terms)\r
+-  (if (null search-terms)\r
+-      (setq search-terms (list "*")))\r
++  (unless search-terms\r
++    (setq search-terms "*"))\r
+   (split-string\r
+    (with-output-to-string\r
+      (with-current-buffer standard-output\r
+-       (apply 'call-process notmuch-command nil t\r
++       (funcall 'call-process notmuch-command nil t\r
+             nil "search" "--output=tags" "--exclude=false" search-terms)))\r
+    "\n+" t))\r
+ \r
+-(defun notmuch-select-tag-with-completion (prompt &rest search-terms)\r
++(defun notmuch-select-tag-with-completion (prompt &optional search-terms)\r
+   (let ((tag-list (notmuch-tag-completions search-terms)))\r
+     (completing-read prompt tag-list nil nil nil 'notmuch-select-tag-history)))\r
+ \r
+-(defun notmuch-read-tag-changes (&optional initial-input &rest search-terms)\r
++(defun notmuch-read-tag-changes (&optional initial-input search-terms)\r
+   (let* ((all-tag-list (notmuch-tag-completions))\r
+        (add-tag-list (mapcar (apply-partially 'concat "+") all-tag-list))\r
+        (remove-tag-list (mapcar (apply-partially 'concat "-")\r
+-                                (if (null search-terms)\r
+-                                    all-tag-list\r
+-                                  (notmuch-tag-completions search-terms))))\r
++                                (if search-terms\r
++                                    (notmuch-tag-completions search-terms)\r
++                                  all-tag-list)))\r
+        (tag-list (append add-tag-list remove-tag-list))\r
+        (crm-separator " ")\r
+        ;; By default, space is bound to "complete word" function.\r
+-- \r
+1.7.9.1\r
+\r