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

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

Re: execute function in replace-regexp


From: tomas
Subject: Re: execute function in replace-regexp
Date: Sun, 1 Oct 2017 09:55:00 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Oct 01, 2017 at 05:22:28AM +0200, Emanuel Berg wrote:
> How can I execute a Lisp function, namely
> `downcase', on the match from `replace-regexp'?
> 
> I Googled it and found [1] the syntax
> 
>     \, (downcase \1)
> 
> but doesn't get executed, just replaced as is.

 - There should be no space between the comma and the paren:
   \,(...)

 - I *think* you should string-quote the \1 (the \1 itself gets,
   AFAIR, replaced literally: to have correct elisp you need
   quotes, but I might be wrong on that)

This would make:

     \,(downcase "\1")

Cheers
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlnQn1QACgkQBcgs9XrR2kaiNwCfbH21XW7lqm1mSOGmk1xpnI74
0hEAniA4jqwA5Vi/YvKyYnwwbCUECzzZ
=cfqz
-----END PGP SIGNATURE-----



reply via email to

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