[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conversation View



On Mon, Aug 23, 2010 at 8:59 AM, Erik Hetzner <ehetzner@gmail.com> wrote:
> At Sun, 22 Aug 2010 16:06:48 -0800,
> David Abrahams wrote:
>>
>> At Sun, 22 Aug 2010 14:48:26 -0700,
>> Erik Hetzner wrote:
>> >
>> > Thanks for debugging my code & my thinking! You are correct. I
>> > assumed we needed to gather more references because my code wasn’t
>> > working as expected, but it does seem we are not getting all
>> > references from the msgdb.
>> >
>> > I don’t know why the msgdb is not keeping all the references
>> > around.
>>
>> I feel certain it's a bug, though there are a few places in the code
>> that look suspiciously as though they're relying on that bug by
>> assuming references contains a single UID.
>
> That sounds like it could be a difficult bug to fix if it is that
> entrenched.

It's not a big deal from what I can see.  Just a few places where it crops up.

>> > Here is another version based on the code in
>> > wl-summary-jump-to-parent-message which works around the problem.
>>
>> Yes!  However, I think you may be making the filter more complicated
>> than absolutely necessary.  I'm not sure whether that slows things
>> down or not, but again, unless M[TU]As are ill-behaved, it should be
>> enough to find every message whose message-id or references field
>> contain the first UID in references.
>
> Of course, I should have read that post more carefully. I didn’t know
> that References was an ordered list. That simplifies the code a lot.

According to http://www.faqs.org/rfcs/rfc2822.html, it is... but we
might get foiled by the rare message that has multiple parents.  I
can't imagine a good reason for the RFC's advice about such messages
to leave out the references: field.

BTW, it looks like we maybe should be more sophisticated about
gathering UIDs:
http://forum.rebex.net/questions/228/imap-processing-of-mail-header-references-with-multiple-msgids

>> > I notice when turning on elmo-imap4-debug that WL does a search for:
>> >
>> >   uid search all undeleted
>> >
>> > when performing this filter, which retrieves all uids.
>>
>> All UIDs, hmm, that seems like another bug.  I guess this could be a
>> lot faster if it didn't have to do that.
>>
>> > Does anybody know why this is happening, or how it might be
>> > prevented?
>>
>> Do you think those concerned are likely to be paying attention to this
>> thread?  Maybe we should post both these issues as separate bug
>> reports.
>
> It’s not strictly a bug, I think, but perhaps unexpected &
> unnecessary(?) behavior.

Performance problems are bugs in my book :-)

> Visiting the filter folder calls
> elmo-folder-synchronize on the filter folder which calls
> elmo-folder-synchronize on the IMAP folder, which calls
> elmo-folder-list-messages, which results in all messages being
> returned. This does not seem strictly necessary, but perhaps it
> is.

Seems highly unlikely that it's necessary for our use case, at least.

> Here is a new version of this function. I have bound it to X for the
> time being, and if it is called with C-u it should jump back to where
> you came from.

Nice!  any other substantive changes?
We should probably stick the source summary buffer, at least temporarily, neh?

> best, Erik
>
> (defvar egh:wl-summary-prev-folder-name nil)
>
> (defun egh:wl-summary-visit-conversation (&optional close)
>  (interactive "P")
>  (if close
>      (if egh:wl-summary-prev-folder-name
>          (wl-summary-goto-folder-subr egh:wl-summary-prev-folder-name
>                                       'no-sync nil nil t)
>        (message "No previous folder to visit."))
>    (let (folder-name prev-folder-name)
>      (save-excursion
>        (setq prev-folder-name wl-summary-buffer-folder-name)
>        (wl-summary-set-message-buffer-or-redisplay)
>        (set-buffer (wl-message-get-original-buffer))
>        (let* ((ref (substring (car (split-string (or (std11-field-body "References")
>                                                      (std11-field-body "Message-Id")))) 1 -1)))
>          (setq folder-name (concat "/message-id:\"" ref
>                                    "\"|references:\"" ref
>                                    "\"/" (egh:wl-all-folder)))))
>      (wl-summary-goto-folder-subr folder-name 'update nil nil t)
>      (setq egh:wl-summary-prev-folder-name prev-folder-name)
>      (make-local-variable 'egh:wl-summary-prev-folder-name))))
>
> (define-key wl-summary-mode-map "X" 'egh:wl-summary-visit-conversation)
>



-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com