Re: [RFC PATCH v2 8/8] WIP: add notmuch-tag-undo

Subject: Re: [RFC PATCH v2 8/8] WIP: add notmuch-tag-undo

Date: Wed, 02 Feb 2022 10:34:37 -0400



From: David Bremner

David Bremner <> writes:

> +(defun notmuch-tag-undo ()
> +  (interactive)
> +  (when (null notmuch-tag-history)
> +    (error "no further notmuch undo information"))
> +  (let* ((action (pop notmuch-tag-history))
> +	 (from (plist-get action :from))
> +	 (to (plist-get action :to))
> +	 (changes (notmuch-tag-change-list (plist-get action :tag-changes) t))
> +	 (query (format "lastmod:%d..%d" from to)))
> +    (when (<= from to)
> +      (notmuch-tag query changes t))))

I got pretty far down this path before I realized there is a fundamantal
flaw with using lastmod info for undo. With some extra work, we can only
manage one level of undo, since the undo operation itself invalidates
the queries in the undo history. So now I don't really know the best

notmuch mailing list --
To unsubscribe send an email to