help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: What's the best way to do "string-memq"?


From: Drew Adams
Subject: RE: What's the best way to do "string-memq"?
Date: Mon, 10 Nov 2008 10:17:54 -0800

> I need a predicate which I'd ideally like to write as
>     (string-memq (char-after) skip-chars)
> , where skip-chars is a string like "^;{}?:", and the predicate should
> return t when (char-after) is one of (?^ ?\; ?\{ ?\} ?\? ?\:).

Here are a couple of ways:

(string-match (regexp-quote
               (char-to-string (char-after)))
              skip-chars)

(member (char-after) (string-to-list skip-chars))

(They return non-nil, not t, but you can fix that.) Someone else will probably
show you a better way. And you're right that cl offers this out of the box.





reply via email to

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