* Problem with gnus-registry-grep-in-list
@ 2008-05-05 18:38 Joao Cachopo
2008-05-05 21:42 ` Ted Zlatanov
0 siblings, 1 reply; 3+ messages in thread
From: Joao Cachopo @ 2008-05-05 18:38 UTC (permalink / raw)
To: ding
Hi!
Today I've tracked down a problem that has been bugging me for some time
now.
I use gnus-registry-split-fancy-with-parent to split the replies to the
messages that I send into the proper folder.
Most of the times, my original message is GCCed into some specific
group, but sometimes it is archived into my nnml:sent.mail.* groups.
In this last case, however, I don't want to split the replies into the
sent.mail group.
Therefore, I added "sent.mail" to gnus-registry-unfollowed-groups.
But still, the replies are split into the sent.mail group.
I've found the problem in the function gnus-registry-grep-in-list, which
is called by the function gnus-registry-follow-group-p:
(defun gnus-registry-follow-group-p (group)
"Determines if a group name should be followed.
Consults `gnus-registry-unfollowed-groups' and
`nnmail-split-fancy-with-parent-ignore-groups'."
(not (or (gnus-registry-grep-in-list
group
gnus-registry-unfollowed-groups)
(gnus-registry-grep-in-list
group
nnmail-split-fancy-with-parent-ignore-groups))))
As you can see, the gnus-registry-grep-in-list is called twice with the
group that we want to see whether it should be followed or not and a
list of regexps to ignore. Yet, if we look into the
gnus-registry-grep-in-list function:
(defun gnus-registry-grep-in-list (word list)
(when word
(memq nil
(mapcar 'not
(mapcar
(lambda (x)
(string-match word x))
list)))))
The string-match function is called with the regexp in the second
argument, rather than the first.
Actually, according to the CVS logs, this was a deliberate change made
in revision 7.37:
date: 2007/09/12 09:16:25; author: tzz; state: Exp; lines: +3 -3
(gnus-registry-unfollowed-groups): Add INBOX to the
list of groups not followed by default. Fix type to be regexp.
(gnus-registry-grep-in-list): Fix inverted parameters to string-match.
As the gnus-registry-grep-in-list function is used in one more place
(the function gnus-registry-find-keywords), I'm not sure that swapping
the arguments of the string-match again will not break this other
functionality.
Can someone comment on this (and fix it, please)?
Best regards,
--
João Cachopo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Problem with gnus-registry-grep-in-list
2008-05-05 18:38 Problem with gnus-registry-grep-in-list Joao Cachopo
@ 2008-05-05 21:42 ` Ted Zlatanov
2008-05-06 8:19 ` Joao Cachopo
0 siblings, 1 reply; 3+ messages in thread
From: Ted Zlatanov @ 2008-05-05 21:42 UTC (permalink / raw)
To: Joao Cachopo; +Cc: ding
On Mon, 05 May 2008 19:38:56 +0100 Joao Cachopo <joao@cachopo.org> wrote:
JC> The string-match function is called with the regexp in the second
JC> argument, rather than the first.
Fixed, please test. I used catch/throw now instead of mapcar, it should
be more efficient.
JC> Actually, according to the CVS logs, this was a deliberate change made
JC> in revision 7.37:
JC> date: 2007/09/12 09:16:25; author: tzz; state: Exp; lines: +3 -3
JC> (gnus-registry-unfollowed-groups): Add INBOX to the
JC> list of groups not followed by default. Fix type to be regexp.
JC> (gnus-registry-grep-in-list): Fix inverted parameters to string-match.
My mistake, sorry.
JC> As the gnus-registry-grep-in-list function is used in one more place
JC> (the function gnus-registry-find-keywords), I'm not sure that swapping
JC> the arguments of the string-match again will not break this other
JC> functionality.
I doubt anyone uses gnus-registry-find-keywords, but I fixed it anyhow
to just use the member function instead of the regular expression
matching.
Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-06 8:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-05 18:38 Problem with gnus-registry-grep-in-list Joao Cachopo
2008-05-05 21:42 ` Ted Zlatanov
2008-05-06 8:19 ` Joao Cachopo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).