Gnus development mailing list
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Subject: Re: Symbol's function definition is void: remove-if-not
Date: Mon, 04 Oct 2010 11:36:14 -0500	[thread overview]
Message-ID: <8762xhewzl.fsf@lifelogs.com> (raw)
In-Reply-To: <b4mk4lyctsj.fsf@jpl.org>

On Mon, 04 Oct 2010 16:15:56 +0900 Katsumi Yamaoka <yamaoka@jpl.org> wrote: 

KY> Ted Zlatanov wrote:
KY> [...]
>> Can you use `gnus-remove-if' with the predicate inverted?

KY> It can be used, if the type of a sequence is `list'.

I know, I meant for Julien's case specifically, I think he's just using
lists.  In general our (Gnus) usage is pretty trivial, without using all
the bells and whistles of the CL function.

KY> For a non- list sequence, we can convert it to a list as the
KY> function `coerce' does (see cl-extra.el).  Though the type of a
KY> modified sequence has to be changed again into that of the original
KY> (if needed).  However, it may be hard to make it work for a hash
KY> table.  So is the genuine `remove-if-not'!

>> It looks like `remove-if-not' is used in several places actually:

>> gnus-art.el:         (remove-if-not pred (mailcap-mime-types))
>> gnus-group.el:                          (remove-if-not 'symbolp collection)))
>> gnus-score.el:                                            (remove-if-not

Those three should be able to use `gnus-remove-if' with the predicate
inverted, I think.

>> gnus-sum.el:             (remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb)
>> gnus-sum.el:             prom (remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb)

KY> The use of `remove-if-not' in gnus-sum.el is a wrong approach since
KY> it doesn't necessarily recognize all the group names in
KY> `gnus-active-hashtb'.  That looks like a normal vector of which
KY> the length is 4096, however it can hold more than 4096 group names
KY> and `remove-if-not' cannot access all of them.

So it's potentially a bug.  I am no expert on ELisp data types,
especially between Emacs and XEmacs.  Should we take this to emacs-devel
or does someone know a good solution?

I think it's acceptable to simply provide `gnus-remove-hashtb-keys-if'
rather than try to reimplement CL.  So maybe that's the right way.

Ted




  reply	other threads:[~2010-10-04 16:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-03 15:13 Stephen Berman
2010-10-03 15:23 ` Julien Danjou
2010-10-04  3:49   ` Ted Zlatanov
2010-10-04  7:15     ` Katsumi Yamaoka
2010-10-04 16:36       ` Ted Zlatanov [this message]
2010-10-04 16:42         ` Lars Magne Ingebrigtsen
2010-10-05  7:32         ` Katsumi Yamaoka
2010-10-08 16:35           ` Ted Zlatanov
2010-10-04 16:30     ` Ted Zlatanov
2010-10-04 16:42       ` Lars Magne Ingebrigtsen
2010-10-08 16:36         ` Ted Zlatanov

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=8762xhewzl.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --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).