emacs-devel
[Top][All Lists]
Advanced

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

Re: FIXED!! Re: Clarification of eval-after-load [was: Problem mit symli


From: Alan Mackenzie
Subject: Re: FIXED!! Re: Clarification of eval-after-load [was: Problem mit symlinks, locate-library and load-history]
Date: Tue, 23 May 2006 20:10:47 +0000 (GMT)

'n Abend, Andreas!

On Tue, 23 May 2006, Andreas Schwab wrote:

>Alan Mackenzie <address@hidden> writes:
>
>> --- 1385,1499 ----
>>               t))
>>        nil))
>>   
>> + (defun list-to-regexp (arg)
>> +   "Build a regexp that matches any of the elements of ARG, a list of 
>> strings."
>> +   (if arg
>> +       (let ((regexp "\\("))
>> +    (mapc (lambda (elt)
>> +            (setq regexp (concat regexp (regexp-quote elt) "\\|")))
>> +          arg)
>> +    (aset regexp (1- (length regexp)) ?\))
>> +    regexp)
>> +     ""))

>I think this is equivalent to this:
>
>  (concat "\\(" (mapconcat 'regexp-quote arg "\\|") "\\)")

Thanks!  I didn't know about mapconcat.

Even better, mapconcat is a built-in function, so there's no hassle with
order of loading files.el, or with CL or anything like that.

So yes, I'll put the form in that you suggest, since it's certainly an
improvement.

Thanks again!

>Andreas.

-- 
Alan.






reply via email to

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