unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: tree: make tag updates show in the message pane
@ 2016-10-15 18:25 Mark Walters
  2016-10-23  1:52 ` David Bremner
  2016-10-26  1:04 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Walters @ 2016-10-15 18:25 UTC (permalink / raw)
  To: notmuch

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

bremner pointed out that the tags shown in the message pane in tree
view are not updated when tag changes are applied in the tree
view. For the reasons given above this is hard to get fully
right. Also the message shown in the message pane need not be the
message being updated. But this at least improves things, and the
common situation will be shown correctly.

Best wishes

Mark


emacs/notmuch-tree.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 1555812..144c0c3 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -365,12 +365,18 @@ updated."
 (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))
-	 (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)
-      (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"
-- 
2.1.4

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

* Re: [PATCH] emacs: tree: make tag updates show in the message pane
  2016-10-15 18:25 [PATCH] emacs: tree: make tag updates show in the message pane Mark Walters
@ 2016-10-23  1:52 ` David Bremner
  2016-10-26  1:04 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2016-10-23  1:52 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

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

Seems to be an improvement, +1

d

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

* Re: [PATCH] emacs: tree: make tag updates show in the message pane
  2016-10-15 18:25 [PATCH] emacs: tree: make tag updates show in the message pane Mark Walters
  2016-10-23  1:52 ` David Bremner
@ 2016-10-26  1:04 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2016-10-26  1:04 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> This makes tag changes appear in the message pane as well as in the
> tree window.
>

pushed to master

d

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

end of thread, other threads:[~2016-10-26  1:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-15 18:25 [PATCH] emacs: tree: make tag updates show in the message pane Mark Walters
2016-10-23  1:52 ` David Bremner
2016-10-26  1:04 ` David Bremner

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