From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: fcc-insert: mark read when inserting
Date: Mon, 3 Oct 2016 19:30:05 +0100 [thread overview]
Message-ID: <1475519405-13014-1-git-send-email-markwalters1009@gmail.com> (raw)
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
next reply other threads:[~2016-10-03 18:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-03 18:30 Mark Walters [this message]
2016-10-04 1:32 ` [PATCH] emacs: fcc-insert: mark read when inserting David Bremner
2016-10-04 10:57 ` Mark Walters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475519405-13014-1-git-send-email-markwalters1009@gmail.com \
--to=markwalters1009@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).