[PATCH 3/6] emacs: use new tag change helper to mark messages as replied
authorJani Nikula <jani@nikula.org>
Sun, 2 Sep 2012 19:58:02 +0000 (22:58 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:19 +0000 (09:49 -0800)
67/e74c6bee5498c94bea1afe0e25f5ba453696c2 [new file with mode: 0644]

diff --git a/67/e74c6bee5498c94bea1afe0e25f5ba453696c2 b/67/e74c6bee5498c94bea1afe0e25f5ba453696c2
new file mode 100644 (file)
index 0000000..13c56c0
--- /dev/null
@@ -0,0 +1,121 @@
+Return-Path: <jani@nikula.org>\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 D93A8431FD2\r
+       for <notmuch@notmuchmail.org>; Sun,  2 Sep 2012 12:58:23 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[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 mWJmzvQmifko for <notmuch@notmuchmail.org>;\r
+       Sun,  2 Sep 2012 12:58:22 -0700 (PDT)\r
+Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
+       [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 791F1431FB6\r
+       for <notmuch@notmuchmail.org>; Sun,  2 Sep 2012 12:58:19 -0700 (PDT)\r
+Received: by mail-lb0-f181.google.com with SMTP id gk1so2402453lbb.26\r
+       for <notmuch@notmuchmail.org>; Sun, 02 Sep 2012 12:58:19 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
+       :in-reply-to:references:x-gm-message-state;\r
+       bh=Mkn9TK1sHf5CySfoiOCqgWqcUzogWz45q6lpv8KJebg=;\r
+       b=av0ST6I0F1nqbGE1cop4VMGD7EeftKPTtay32DnitSuVm5qXhM68P0PGTImI455lmG\r
+       2lNPiiK8JsjcGa9NRETZrfn2N/UEkzE9EydtvD3QCuzjm96vceQGrAZaQmXS29dWVO2h\r
+       Zk4osjfbjtCUatI+JtyJxp+zu1M6/OKCwBH9OXvZNsjO7T4qfCJY42LxpJvBqkY1G8QK\r
+       rWrBDapsn0xYqt7e5tQtP3N90Ipicx+JU38DZpiVBisiLyi01QIAUIyb3U8eqylDp6KT\r
+       ys2zNuwFV5sRU+Pv2i2nFtsVISMmU4U5N3pEoufqvOyMoP6n2Af0vLnp6Jis4bbnd9Bd\r
+       syUQ==\r
+Received: by 10.152.146.163 with SMTP id td3mr12139408lab.26.1346615899135;\r
+       Sun, 02 Sep 2012 12:58:19 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.\r
+       [80.223.81.27])\r
+       by mx.google.com with ESMTPS id j3sm2752411lbh.0.2012.09.02.12.58.17\r
+       (version=SSLv3 cipher=OTHER); Sun, 02 Sep 2012 12:58:18 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/6] emacs: use new tag change helper to mark messages as\r
+       replied\r
+Date: Sun,  2 Sep 2012 22:58:02 +0300\r
+Message-Id:\r
+ <0e05c186f028a6d526dd74b4244c39faca3a4960.1346614915.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.9.5\r
+In-Reply-To: <cover.1346614915.git.jani@nikula.org>\r
+References: <cover.1346614915.git.jani@nikula.org>\r
+In-Reply-To: <cover.1346614915.git.jani@nikula.org>\r
+References: <cover.1346614915.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQm89L6VYbTCbxJDQYGcYd1QTEic7cYoKzb/k2jB7Q+rCyfvSIFL/Ch/DZIy708HGXQrsBWU\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, 02 Sep 2012 19:58:24 -0000\r
+\r
+Clarify documentation while at it.\r
+---\r
+ emacs/notmuch-message.el |   24 ++++++++++--------------\r
+ 1 file changed, 10 insertions(+), 14 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el\r
+index 3798046..4dc4883 100644\r
+--- a/emacs/notmuch-message.el\r
++++ b/emacs/notmuch-message.el\r
+@@ -23,14 +23,16 @@\r
+ (require 'notmuch-tag)\r
+ (require 'notmuch-mua)\r
\r
+-(defcustom notmuch-message-replied-tags '("replied")\r
+-  "Tags to be automatically added to or removed from a message when it is replied to.\r
+-Any tag in the list will be added to a replied message or,\r
+-if it is prefaced with a \"-\", removed.\r
++(defcustom notmuch-message-replied-tags '("+replied")\r
++  "List of tag changes to apply to a message when it has been replied to.\r
++\r
++Tags starting with \"+\" (or not starting with either \"+\" or\r
++\"-\") in the list will be added, and tags starting with \"-\"\r
++will be removed from the message being replied to.\r
\r
+ For example, if you wanted to add a \"replied\" tag and remove\r
+-the \"inbox\" and \"todo\", you would set\r
+-    (\"replied\" \"-inbox\" \"-todo\"\)"\r
++the \"inbox\" and \"todo\" tags, you would set:\r
++    (\"+replied\" \"-inbox\" \"-todo\"\)"\r
+   :type '(repeat string)\r
+   :group 'notmuch-send)\r
\r
+@@ -38,14 +40,8 @@ the \"inbox\" and \"todo\", you would set\r
+   ;; get the in-reply-to header and parse it for the message id.\r
+   (let ((rep (mail-header-parse-addresses (message-field-value "In-Reply-To"))))\r
+     (when (and notmuch-message-replied-tags rep)\r
+-      ;; add a "+" to any tag that is doesn't already begin with a "+"\r
+-      ;; or "-"\r
+-      (let ((tags (mapcar (lambda (str)\r
+-                          (if (not (string-match "^[+-]" str))\r
+-                              (concat "+" str)\r
+-                            str))\r
+-                        notmuch-message-replied-tags)))\r
+-      (funcall 'notmuch-tag (notmuch-id-to-query (car (car rep))) tags)))))\r
++      (funcall 'notmuch-tag (notmuch-id-to-query (car (car rep)))\r
++             (notmuch-tag-change-list notmuch-message-replied-tags)))))\r
\r
+ (add-hook 'message-send-hook 'notmuch-message-mark-replied)\r
\r
+-- \r
+1.7.9.5\r
+\r