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

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

Date: Wed, 18 Jan 2012 00:47:11 -0800

To: David Edmondson, Notmuch Mail

Cc:

From: Jameson Graef Rollins


On Wed, 18 Jan 2012 08:12:27 +0000, David Edmondson <dme@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.
part-000.sig (application/pgp-signature)

Thread: