如何定义使用`replace-string`替换特定字符串的Emacs命令
问题描述:
我需要删除ascii字符0253,并在其中添加回车符。在emacs中我执行
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
Cq Cj添加回车符。我经常这样做,我创建一个自定义的defun会更好。
C-q C-j adds a carriage return. I do this often enough that I creating a custom defun would be much better.
这是我到目前为止
(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 )
)
你的想法?
谢谢,
规范
答
这对我有用:
(replace-string "ý" "\n")