info-gnus-english
[Top][All Lists]
Advanced

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

Re: per group value of gnus-summary-thread-gathering-function?


From: Giorgos Keramidas
Subject: Re: per group value of gnus-summary-thread-gathering-function?
Date: Tue, 29 Jul 2008 06:41:45 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix)

On Tue, 29 Jul 2008 05:34:29 +0300, Giorgos Keramidas 
<keramida@ceid.upatras.gr> wrote:
> On Mon, 28 Jul 2008 16:54:19 +0200, bojohan+news@dd.chalmers.se (Johan 
> Bockgård) wrote:
>> Giorgos Keramidas <keramida@ceid.upatras.gr> writes:
>>
>>>             (dolist (pair keramida-gnus-group-thread-function-map)
>>>               (message "pair is %s" pair)
>>>               (if (not match-function)
>>>                   (let ((pattern (car pair))
>>>                         (func (cdr pair)))
>>>                     (if (and (string-match pattern group)
>>>                              (fboundp func))
>>>                         (setq match-function func))))))
>>
>>     (assoc-default group keramida-gnus-group-thread-function-map
>>                    'string-match)
>
> Thank you! :)

After a bit of testing, the new threading function I'm using is:

(defun keramida-gnus-gather-threads (threads)
  "Dispatch function that matches Gnus group names to thread
gathering functions by looking up the group name in the
`keramida-gnus-group-thread-function-map'."
  (let ((group gnus-newsgroup-name)
        (gather-function (or (and (fboundp 
'keramida-gnus-gather-threads-default)
                                    (function 
keramida-gnus-gather-threads-default))
                               (and (fboundp 'gnus-gather-threads-by-references)
                                    (function 
gnus-gather-threads-by-references)))))
    (let ((match-function (and group
                               (boundp 'keramida-gnus-group-thread-function-map)
                               (assoc-default group 
keramida-gnus-group-thread-function-map
                                              'string-match))))
      (funcall (or match-function gather-function) threads))))

This seems more 'Lispy' than the previous dolist-based version :)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]