emacs-devel
[Top][All Lists]
Advanced

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

Re: Improve `replace-regexp-in-string' ergonomics?


From: Lars Ingebrigtsen
Subject: Re: Improve `replace-regexp-in-string' ergonomics?
Date: Wed, 22 Sep 2021 22:29:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

>>     (foo-replace results
>>       ("\\[" "(")
>>       ("\\]" ")")
>>       ("[[:lower:]]+" (upcase (match-string 0)))
>>       ("siglo \\([0-9]+\\)"
>>        (integer-to-roman (string-to-number (match-string 1))))
>>       ...)
>
> Perfect.  That looks like a really nice function signature to me.
> Perhaps without the parentheses if there's only one replacement to be
> done.

(And there could be an optional third element in the replacement lists
to do the SUBEXP action.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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