Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 22614431FDA for ; Thu, 6 Sep 2012 08:32:58 -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 Dc1QBNvQj2kd for ; Thu, 6 Sep 2012 08:32:56 -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 DFF3C429E2F for ; Thu, 6 Sep 2012 08:32:55 -0700 (PDT) Received: by mail-lb0-f181.google.com with SMTP id gk1so1344042lbb.26 for ; Thu, 06 Sep 2012 08:32:55 -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=Nrxo3+A6Sb/0k5N2qsuK1eDgIb14GluaBaFMSCXijUiWTlfN465VBhHfKTkIRpsX4I mtCPP5YWX3mBjbSkchfBWYWxizuhnVlNuQ8p5DoHZneCItKlYNiGUpSwq7PN+jRudtt2 zkEFFiOULoIVSUTc9zLEFIFb6nsKDNvZxX+g0iDbzDPI6SKK665brWuSe4/RCpUIbGhk zymQLuWjgm+TYox4sWUKIbRamvPyqljgQXBn46vo8fNVoJ0rXoqctNXnxAAADgS/VPxO uveaQERhfqKCutI36yHkthYNmOZaD9S4UllNtg0mp/eJH0uy4Sabxdbxfq6wXnO7IsQy p9nQ== Received: by 10.112.26.106 with SMTP id k10mr1022798lbg.100.1346945575441; Thu, 06 Sep 2012 08:32:55 -0700 (PDT) Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi. [80.223.81.27]) by mx.google.com with ESMTPS id p7sm488554lbg.17.2012.09.06.08.32.53 (version=SSLv3 cipher=OTHER); Thu, 06 Sep 2012 08:32:54 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH v2 3/6] emacs: use new tag change helper to mark messages as replied Date: Thu, 6 Sep 2012 18:32:39 +0300 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQlRxyKQPgTjN2E2ri2ug3DDD1cIwIVYKWl0KcwZ8nhZ5lYordMcaJK//kAoHlpGtZtgxzsw Cc: Tomi Ollila 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: Thu, 06 Sep 2012 15:32:58 -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