]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: tree: make tag updates show in the message pane
authorMark Walters <markwalters1009@gmail.com>
Sat, 15 Oct 2016 18:25:19 +0000 (19:25 +0100)
committerDavid Bremner <david@tethera.net>
Tue, 25 Oct 2016 21:13:16 +0000 (18:13 -0300)
This makes tag changes appear in the message pane as well as in the
tree window.

Note that the message pane is reloaded each time a message is viewed
so the tags shown in the message pane can still be different from
those in the tree window. Usually this will just be that the tag
change is still shown as a change (strikethough underline etc) in the
tree window, and are shown after the change in the message
pane. However, if something else updates the database then the tags
shown can be genuinely different.

emacs/notmuch-tree.el

index d5587a9c6351ca052f23311ae2c865f58ee2688d..1ab0810d59270809173be0957818c621a17a805d 100644 (file)
@@ -364,12 +364,18 @@ updated."
 (defun notmuch-tree-tag-update-display (&optional tag-changes)
   "Update display for TAG-CHANGES to current message.
 
 (defun notmuch-tree-tag-update-display (&optional tag-changes)
   "Update display for TAG-CHANGES to current message.
 
-Does NOT change the database."
+Updates the message in the message pane if appropriate, but does
+NOT change the database."
   (let* ((current-tags (notmuch-tree-get-tags))
   (let* ((current-tags (notmuch-tree-get-tags))
-        (new-tags (notmuch-update-tags current-tags tag-changes)))
+        (new-tags (notmuch-update-tags current-tags tag-changes))
+        (tree-msg-id (notmuch-tree-get-message-id)))
     (unless (equal current-tags new-tags)
       (notmuch-tree-set-tags new-tags)
     (unless (equal current-tags new-tags)
       (notmuch-tree-set-tags new-tags)
-      (notmuch-tree-refresh-result))))
+      (notmuch-tree-refresh-result)
+      (when (window-live-p notmuch-tree-message-window)
+       (with-selected-window notmuch-tree-message-window
+         (when (string= tree-msg-id (notmuch-show-get-message-id))
+           (notmuch-show-update-tags new-tags)))))))
 
 (defun notmuch-tree-tag (tag-changes)
   "Change tags for the current message"
 
 (defun notmuch-tree-tag (tag-changes)
   "Change tags for the current message"