From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 7BC586DE0946 for ; Mon, 3 Oct 2016 11:30:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.064 X-Spam-Level: X-Spam-Status: No, score=0.064 tagged_above=-999 required=5 tests=[AWL=-0.066, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zXI_C5bYDFTV for ; Mon, 3 Oct 2016 11:30:13 -0700 (PDT) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id 2234D6DE0941 for ; Mon, 3 Oct 2016 11:30:13 -0700 (PDT) Received: by mail-wm0-f66.google.com with SMTP id b184so15999234wma.3 for ; Mon, 03 Oct 2016 11:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=nxoVL3HENbQN6varXXZsssb0nLW9QKkT5GWj55FBlGg=; b=bah3lZD48TEdxVzoHA4K0x+pFuH+f5UND/n/D7/pOQz+9HpM7taOynqAnPE3JjQTlT qwol77EQxPjUHXPLHeT1GWoMptwj/+47Z2jEszkcplHTJgJDa9KAJ/o6UMESJX/vgCKP NMYaegK5pXSj4wMYWFHHVt68CRM8U3s2in6cXnnO5m8H1fZ0yaTZwiJAjX8LFIRqH5vX OD9xHPLzcXY+ODlBltbKGdaSOnYCzJSe7gYq3F4DuiwQfCBslGOygqxZJQ1rp9+N83Gd s86v/F2dEFk0aLjNHPGMl8qDofv2jtOc0RDgM07mPhFHFiSvZRU7U/bYD2iZk127cYzH 0V4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nxoVL3HENbQN6varXXZsssb0nLW9QKkT5GWj55FBlGg=; b=BxkHCRa0pfinauOnpcfoy9IbGDmY5trbjgReeVC2/CnLsyiCcwi/hlqk40JzV4F3W/ q8F7qtztDsEe8XBtO4S9IwMLLmv4TzafEBGhZq5Po7wFHSxujp9ExWCgm7yqmWSPpqX0 mDjoacdfuhj+G5R8tziZv0+WdWf7W2Pg2KrpEmQfJ7FMJ753yh68Sh/sCYewgMdkmfZA gKczGsWit6D1bi5EHhO9IeLadkWEXLVGISomm4XMUTjPf8gjA9yuA7ZLWIKXs9v/X8n5 KyyEyUs+FMQmhI4n44s68pg0CYoKDQXT/DYS/DlwTSbobEavHTDWWMvGZ1dH9zbaVf5q /KIQ== X-Gm-Message-State: AA6/9RnEiXl8aDqTRiNeQCYuCbB7oAb+TXHPsDvetfHGgSagrto5cTxo+SEo6ApaJrK3vA== X-Received: by 10.28.167.22 with SMTP id q22mr10004126wme.11.1475519411391; Mon, 03 Oct 2016 11:30:11 -0700 (PDT) Received: from localhost (188.28.44.114.threembb.co.uk. [188.28.44.114]) by smtp.gmail.com with ESMTPSA id qo8sm8010480wjc.46.2016.10.03.11.30.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Oct 2016 11:30:10 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH] emacs: fcc-insert: mark read when inserting Date: Mon, 3 Oct 2016 19:30:05 +0100 Message-Id: <1475519405-13014-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Mon, 03 Oct 2016 18:30:14 -0000 Apply the mark read tags when inserting. These can be overridden by the user specified tags on the fcc line. The full ordering is 1) the normal "new" tags applied according to notmuch-config 2) the tags in notmuch-show-mark-read 3) any user tags on the fcc line --- On irc amdragon suggested that we should not add the unread tag to sent messages fcc'd by notmuch insert. This does this. The slight complication is that the unread tag (or more accurately the tag change to apply when a message is read) is customisable. Thus we apply the tag change to the inserted message. This can be over-ridden by the user (eg specifying "+unread" on the fcc line). We could apply the archive tags at the same time but that seemed more controversial, so is not done here. Note this is not heavily tested, but seems to work. Best wishes Mark emacs/notmuch-maildir-fcc.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index 95e5650..8d444d9 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -27,6 +27,9 @@ (require 'notmuch-lib) +;; The following variable is defined in notmuch-show +(defvar notmuch-show-mark-read-tags) + (defvar notmuch-maildir-fcc-count 0) (defcustom notmuch-fcc-dirs "sent" @@ -230,11 +233,13 @@ should be a list of tag changes to apply to the inserted message." The fcc-header should be of the form \"folder +tag1 -tag2\" where folder is the folder (relative to the notmuch mailstore) to store the message in, and tag1 and tag2 are tag changes to apply to the -stored message. If CREATE is non-nil then create the folder if -necessary." +stored message. These tag changes are applied after both the +normal notmuch insert tag changes, and the tag changes in +`notmuch-show-mark-read-tags' are applied. If CREATE is non-nil +then create the folder if necessary." (let* ((args (split-string-and-unquote fcc-header)) (folder (car args)) - (tags (cdr args))) + (tags (append notmuch-show-mark-read-tags (cdr args)))) (condition-case nil (notmuch-maildir-notmuch-insert-current-buffer folder create tags) ;; Since there are many reasons notmuch insert could fail, e.g., -- 2.1.4