Search code examples
regexemacselisp

How to define an Emacs command that uses `replace-string` to replace a specific string


I need to remove ascii character 0253 and add a carriage return in it's place. In emacs I do

M-x replace-string ý RET C-q C-j

C-q C-j adds a carriage return. I do this often enough that I creating a custom defun would be much better.

Here is what I have so far

(defun remove-253 ()
   "Removes ASCII Character 0253 and adds a carriage return in it's place"
   (interactive)
   (replace-string "ý" .... not sure what to do next )
)

Your thoughts?

Thanks,

Norm


Solution

  • This worked for me:

    (replace-string "ý" "\n")