Sometimes I want to replace [$] with \( and [/$] with \) either in the region or in the whole buffer. replace-string works well for that, except for requiring me to type the strings I want to replace. I would like to call it with these specific strings from an elisp function. How can I do that?

1 Answer 1


From replace-string documentation:

This function is for interactive use only; in Lisp code use search-forward and replace-match instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.