emacs-devel
[Top][All Lists]
Advanced

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

Re: Regexp error scan (March 26)


From: Mattias Engdegård
Subject: Re: Regexp error scan (March 26)
Date: Wed, 27 Mar 2019 10:14:29 +0100

27 mars 2019 kl. 04.43 skrev Basil L. Contovounesios <address@hidden>:
> 
> Paul Eggert <address@hidden> writes:
> 
>>       (replace-regexp-in-string
>> -       (format "[%s]"
>> -               (mapconcat (lambda (char)
>> -                            (regexp-quote (char-to-string char)))
>> -                          erc-lurker-ignore-chars ""))
>> +       (regexp-opt (cl-delete-duplicates
>> +                (mapcar #'char-to-string erc-lurker-ignore-chars)))
>>        "" nick)
>>     nick))
> 
> regexp-opt already deletes duplicates, so you can just:
> 
> (regexp-opt (mapcar #'char-to-string erc-lurker-ignore-chars))
> 
> Besides, cl-delete-duplicates defaults to eql for equality, so it's a
> no-op here anyway.

Or perhaps:

(regexp-opt-charset (append erc-lurker-ignore-chars nil))




reply via email to

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