unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: add global tag history
@ 2022-01-26 15:32 inwit
  2022-01-26 15:40 ` David Bremner
  2023-01-06 11:36 ` David Bremner
  0 siblings, 2 replies; 11+ messages in thread
From: inwit @ 2022-01-26 15:32 UTC (permalink / raw)
  To: notmuch; +Cc: inwit

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-01-10 15:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-26 15:32 [PATCH] emacs: add global tag history inwit
2022-01-26 15:40 ` 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

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).