Gnus development mailing list
 help / color / mirror / Atom feed
From: Joao Cachopo <joao@cachopo.org>
To: ding@gnus.org
Subject: Problem with gnus-registry-grep-in-list
Date: Mon, 05 May 2008 19:38:56 +0100	[thread overview]
Message-ID: <m21w4gr3y7.fsf@cachopo.org> (raw)


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




             reply	other threads:[~2008-05-05 18:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-05 18:38 Joao Cachopo [this message]
2008-05-05 21:42 ` Ted Zlatanov
2008-05-06  8:19   ` Joao Cachopo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m21w4gr3y7.fsf@cachopo.org \
    --to=joao@cachopo.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).