Subject: Re: bug#9831: cause of bug found! [PATCH]

From: Mark Lillibridge <[email-masked]>
Date: Sun, 23 Oct 2011 13:21:53 -0700

>   >     Because this bug doesn't occur in Emacs 22, I compared to that code's
>   > version of rmail-summary:
>  
>  I'm not convinced that the issue you see is related to that reported by
>  the OP.  But since I'm not familiar with rmail could you please explain
>  to me what happens and what should happen below.

    Sorry, more background.  The bug OP and I am reporting is as
follows: we have two Rmail buffers, say A and B, each with summary
buffers.  However, only A and it's summary are displayed in windows.  We
then output the current message from A to B via 'o'.  The bug is that at
this point the summary for B becomes displayed when it should not.

    Why?  The filing code updates the summary for the buffer the
messages being filed to (e.g., B) so that it shows the message just
added to that buffer if appropriate.  This should not cause that summary
to be displayed but it does due to the bug.

    Why?  The summary is updated via (rmail-update-summary).
Historically, this does not cause the updated buffer to be displayed,
but because of the bug if this summary was produced by rmail-summary, it
will be displayed.

    Why? rmail-update-summary makes a saved function call (depending on
the filtering requested, a different call is necessary to rebuild the
summary) to update the summary.  If the summary was originally created via
rmail-summary, then the saved call is (rmail-summary), which because of
the bug displays the summary.

    Why?  Because someone incorrectly added code to display the summary
buffer on summary update to rmail-summary.

    I changed the code so that rmail-summary when called by the user
(e.g., via 'h') does always display the summary but does not do so when
called via rmail-update-summary.

    Is this more clear?  I think the part you were unclear about is that
there are two Rmail buffers involved, each with their own summary.

- Mark