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

Re: Conversation View



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.

> 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.

> 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.

> (defun egh:wl-summary-visit-conversation ()
>   (interactive)
>   (let ((folder-name))
>     (save-excursion
>       (wl-summary-set-message-buffer-or-redisplay)
>       (set-buffer (wl-message-get-original-buffer))
>       (let* ((clean-and-split-ids (lambda (str)
>                                     (mapcar (lambda (msgid)
>                                               (substring msgid 1 -1))
>                                             (split-string str))))
>              (ids (append
>                    (funcall clean-and-split-ids (std11-field-body "Message-Id"))
>                    (funcall clean-and-split-ids (std11-field-body "References"))))
>              (search-condition (mapconcat
>                                 (lambda (ref)
>                                   (concat "message-id:\"" ref
>                                           "\"|references:\"" ref "\""))
>                                 ids "|")))
>         (setq folder-name (concat "/" search-condition
>                                   "/" (egh:wl-all-folder)))))
>     (wl-summary-goto-folder-subr folder-name 'update nil nil t)))

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