On Wed, 18 Jan 2012 08:12:27 +0000, David Edmondson wrote: > No need for brackets around `r'. Please put initialised local variables > before uninitialised. Yeah, that's another comment of Aron's that I forgot to fix this time around. Sorry about that. > > (while (and (setq r (notmuch-show-goto-message-next)) > > (not (notmuch-show-message-visible-p)))) > > (if r > > (progn > > (notmuch-show-mark-read) > > (notmuch-show-message-adjust)) > > - (goto-char (point-max))))) > > + (if (and parent-buffer pop-at-end) > > + (progn > > + (kill-this-buffer) > > + (switch-to-buffer parent-buffer) > > + (forward-line 1)) > > + (goto-char (point-max)))))) > > Can you explain in words how this is expected to behave please? If there is not another message, but there is a parent buffer and the pop-at-end variable is set, kill this buffer, go the parent, and move to the next thread. Otherwise, go to the max point in the buffer. Do you see a problem? The one thing I do realize now is that the behavior might be slightly strange if the parent buffer is itself a show buffer. In that case, the forward-line part doesn't make any sense. It should check that the parent is a search buffer first. It should also use the notmuch-search function to jump to the next thread (notmuch-search-next-thread). The notmuch-show-next-thread function could use the same improvements. jamie.