On Sat, 24 Sep 2016, Ioan-Adrian Ratiu <adi@adirat.com> wrote: > Argh, so right after I posted this I found a bug: for every new window > in which you open the same notmuch-show buffer it creates a new buffer. > > For example if from notmuch-search you open a thread "hello" in multiple > windows, each window will show a different "hello<1>" "hello<2>" etc > buffer instead of showing a single "hello" buffer for all windows. This is really weird. I'm experiencing this bug even without my patches so it's not a fault in my code. I've tried with both emacs 25.1 and the latest emacs git rev, does anyone else experience this behaviour? Am I missing something, is this an expected behaviour and not a bug? > > I'm aware of this issue and I'll fix it in v3, however please if you > have time & feedback for v2 I'd greatly appreciate it. > > Best wishes, > Ionel > > On Sat, 24 Sep 2016, Ioan-Adrian Ratiu <adi@adirat.com> wrote: >> Changes since v1 (thank you Mark for your feedback): >> * Major rewrite/simplification of the notmuch-show refresh patch to >> support simultaneous refreshing multiple windows displaying a buffer >> * Removed the notmuch-show-message-adjust () patch because it's not >> needed after the above rewrite >> * Rewrote notmuch-refresh-all-buffers () to use dolist instead of >> while loop >> * Minor commit message/metadata improvements >> >> This patch series adds a function to refresh all buffers, including an >> option to silently refresh them in the background i.e. to not show the >> newly refreshed buffer in any window. >> >> This is very useful for asynchronously updating all buffers when new >> mail arrives, using logic similar to the following (it's what I use): >> >> (setq process-connection-type nil) >> >> (defun done-index-sentinel (process event) >> (notmuch-refresh-all-buffers t) >> (message "Mail sync complete")) >> >> (defun done-sync-sentinel (process event) >> (message "Indexing mail using notmuch") >> (set-process-sentinel (start-process "notmuch" nil "notmuch" "new") >> 'done-index-sentinel)) >> >> (defun run-mail-sync () >> (message "Syncing mail in background") >> (set-process-sentinel (start-process "mbsync" nil "mbsync" "gmail") >> 'done-sync-sentinel)) >> >> (run-with-idle-timer 600 nil 'run-mail-sync) >> >> Ioan-Adrian Ratiu (4): >> emacs: reuse buffer when refreshing searches >> emacs: notmuch-show: refresh all windows showing a buffer >> emacs: add refresh buffer optional no-display arg >> emacs: notmuch-lib: add refresh all buffers function >> >> emacs/notmuch-lib.el | 22 +++++++++++++++++++--- >> emacs/notmuch-show.el | 19 +++++++++++++------ >> emacs/notmuch.el | 24 ++++++++++++++++-------- >> 3 files changed, 48 insertions(+), 17 deletions(-) >> >> -- >> 2.10.0