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