From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/11251 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.gnus.user Subject: Re: per group value of gnus-summary-thread-gathering-function? Date: Tue, 29 Jul 2008 06:41:45 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <87wsj5jr0m.fsf@kobe.laptop> References: <877ibeasaq.fsf@kobe.laptop> <86iquwepa9.fsf@lifelogs.com> <87ljzrck6a.fsf@kobe.laptop> <87bq0nnp6x.fsf@kobe.laptop> <87zlo1s9je.fsf@kobe.laptop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1217331629 21659 80.91.229.12 (29 Jul 2008 11:40:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Jul 2008 11:40:29 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Tue Jul 29 13:41:19 2008 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KNnZu-0000mx-Gp for gegu-info-gnus-english@m.gmane.org; Tue, 29 Jul 2008 13:41:18 +0200 Original-Received: from localhost ([127.0.0.1]:52942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNnZ0-0006Vt-EN for gegu-info-gnus-english@m.gmane.org; Tue, 29 Jul 2008 07:40:22 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.gnus User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) Cancel-Lock: sha1:dqXgFmSF0d0uThV4IzpMgXjwEGE= Original-Lines: 38 Original-NNTP-Posting-Host: 77.49.240.117 Original-X-Trace: news.sunsite.dk DXC=1YWY^U9O7XPU2^?UCAZL^MjWbH?lJH1Tkj\I=RMJjhf4o^nG>GH@?S>>^ Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.gnus:81471 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:11251 Archived-At: On Tue, 29 Jul 2008 05:34:29 +0300, Giorgos Keramidas wrote: > On Mon, 28 Jul 2008 16:54:19 +0200, bojohan+news@dd.chalmers.se (Johan Bockgård) wrote: >> Giorgos Keramidas 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 :)