From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: execute function in replace-regexp Date: Sun, 1 Oct 2017 09:55:00 +0200 Message-ID: <20171001075500.GC16509@tuxteam.de> References: <864lrjwo0b.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed X-Trace: blaine.gmane.org 1506844550 16777 195.159.176.226 (1 Oct 2017 07:55:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Oct 2017 07:55:50 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 01 09:55:41 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyZ6C-0003Er-Kc for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Oct 2017 09:55:40 +0200 Original-Received: from localhost ([::1]:41457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyZ6G-0003fK-Tp for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Oct 2017 03:55:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyZ5l-0003dt-EH for help-gnu-emacs@gnu.org; Sun, 01 Oct 2017 03:55:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyZ5h-0006wt-Lh for help-gnu-emacs@gnu.org; Sun, 01 Oct 2017 03:55:13 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:53349 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyZ5h-0006hH-Dg for help-gnu-emacs@gnu.org; Sun, 01 Oct 2017 03:55:09 -0400 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1dyZ5Y-0004b6-HO for help-gnu-emacs@gnu.org; Sun, 01 Oct 2017 09:55:00 +0200 In-Reply-To: <864lrjwo0b.fsf@zoho.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114488 Archived-At: -----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-----