Re: [PATCH 5/5] emacs: Retain the state of the buffer during `notmuch-show-refresh-view'.

Subject: Re: [PATCH 5/5] emacs: Retain the state of the buffer during `notmuch-show-refresh-view'.

Date: Tue, 31 Jan 2012 06:17:58 +0000

To: Mark Walters, notmuch@notmuchmail.org

Cc:

From: David Edmondson


On Mon, 30 Jan 2012 20:19:23 +0000, Mark Walters <markwalters1009@gmail.com> wrote:
> The first is that I currently sometimes use = (that is
> notmuch-show-refresh-view) as a way to go back to the original state (ie
> which messages are open and back to the first message) so I am not sure
> the keep state version should completely replace the old one. (Maybe
> there is an alternative way to achieve the same effect that I don't
> know!)

Thinking about it afterwards, I agree. That is:
    - '=' should behave as though the buffer was remade anew,
    - the toggle commands should retain the state.

> Secondly in
> 
> >  (defun notmuch-show-refresh-view ()
> >    "Refresh the current view.
> >  
> >  Refreshes the current view, observing changes in cryptographic preferences."
> >    (interactive)
> > -  (let ((inhibit-read-only t))
> > -    (erase-buffer))
> > -  (notmuch-show-worker notmuch-show-thread-id notmuch-show-parent-buffer
> > -		       notmuch-show-query-context))
> > +  (let ((inhibit-read-only t)
> > +	(state (notmuch-show-capture-state)))
> > +    (erase-buffer)
> > +    (notmuch-show-worker notmuch-show-thread-id notmuch-show-parent-buffer
> > +			 notmuch-show-query-context)
> > +    (notmuch-show-apply-state state)))
> 
> how would you feel about a (notmuch-show-message-adjust) at the end?

Agreed.
part-000.sig (application/pgp-signature)

Thread: