[OS X Emacs] elisp function in regexp replacement string returns error

Emil Marceta emarceta at gmail.com
Fri Jul 11 03:44:37 EDT 2008


Hi there,

In emacs 22, there's a new feature that allows you to put a elisp
function as your replacement string. This is done by giving the
replacement string this form " \,(fun-name)", where fun-name is your
elisp function.

However when I try to run say (marked region regexp replace):

(replace-regexp "_\\(.\\)" "\\,(downcase \\1)" nil (if (and
transient-mark-mode mark-active) (region-beginning)) (if (and
transient-mark-mode mark-active) (region-end)))

the error message  shows up :

Invalid use of `\' in replacement text

Any thoughts what I'm doing wrong?

thanks,
emil



More information about the MacOSX-Emacs mailing list