From: inwit <inwit@sindominio.net>
To: notmuch@notmuchmail.org
Cc: inwit <inwit@sindominio.net>
Subject: [PATCH] emacs: add global tag history
Date: Wed, 26 Jan 2022 16:32:14 +0100 [thread overview]
Message-ID: <20220126153214.1366353-1-inwit@sindominio.net> (raw)
Save a list of every tag change in the new variable notmuch-tag-history.
---
Storing the full history of tags can prove useful for a) repeated tag
changes as in [0] and b) eventually logging and undoing tag changes.
This is my first commit in elisp. I expect turbulences ahead. :)
[0]
https://nmbug.notmuchmail.org/nmweb/show/CCSQ9HR3M748.2IRNNTHYR4A2M%40bisio
emacs/notmuch-tag.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 8af09e68..68341cf2 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -388,6 +388,9 @@ the messages that were tagged."
(defvar notmuch-read-tag-changes-history nil
"Minibuffer history of `notmuch-read-tag-changes' function.")
+(defvar notmuch-tag-history nil
+ "Global history of `notmuch-tag' function.")
+
(defun notmuch-tag-completions (&rest search-terms)
"Return a list of tags for messages matching SEARCH-TERMS.
@@ -478,6 +481,7 @@ notmuch-after-tag-hook will be run."
(unless query
(error "Nothing to tag!"))
(when tag-changes
+ (push tag-changes notmuch-tag-history)
(notmuch-dlet ((tag-changes tag-changes)
(query query))
(run-hooks 'notmuch-before-tag-hook))
--
2.32.0
next reply other threads:[~2022-01-26 15:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 15:32 inwit [this message]
2022-01-26 15:40 ` [PATCH] emacs: add global tag history David Bremner
2022-01-26 16:08 ` inwit
2022-01-26 16:29 ` Carl Worth
2022-01-26 17:43 ` Jose Antonio Ortega Ruiz
2022-01-27 12:23 ` inwit
2022-01-26 17:48 ` David Bremner
2022-01-26 18:00 ` David Bremner
2022-01-27 12:28 ` David Bremner
2023-01-06 11:36 ` David Bremner
2023-01-10 15:29 ` inwit
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=20220126153214.1366353-1-inwit@sindominio.net \
--to=inwit@sindominio.net \
--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).