[PATCH 4/6] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end

Jameson Graef Rollins jrollins at finestructure.net
Wed Jan 18 00:47:11 PST 2012


On Wed, 18 Jan 2012 08:12:27 +0000, David Edmondson <dme at dme.org> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120118/9423fcd1/attachment.pgp>


More information about the notmuch mailing list