emacs - Emacs Lisp中的replace-char?

标签 emacs elisp

Emacs Lisp有replace-string,但没有replace-char。我想用常规的ASCII引号替换“打印” curl 引号(此字符的Emacs代码为十六进制53979),我可以这样:

(replace-string (make-string 1 ?\x53979) "'")

我认为replace-char会更好。

做这个的最好方式是什么?

最佳答案

为什么不只是使用

(replace-string "\x53979" "'")

或者
(while (search-forward "\x53979" nil t)
    (replace-match "'" nil t))

如文档中所建议的那样,替换字符串?

关于emacs - Emacs Lisp中的replace-char?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/90977/

相关文章:

Emacs/AUCTeX : run command on file that is not currently open

string - Emacs Lisp 中字符串的字符列表

emacs - Emacs 中的 Elixir : UndefinedFunctionError: module is not available

emacs - 有纯HTML5 Emacs模式吗?

emacs - 在Emacs 23中关闭字体的抗锯齿功能

Emacs 颜色和字体困惑

r - 使 Emacs ESS 遵循 R 风格指南

vim - 与其他任何IDE或文本编辑器相比,使用emacs,vim和nano之类的东西有什么好处?

emacs - 如何在 Emacs 中打开/关闭特定模式?

emacs - 如何获取 elisp 时间指定的月份中的天数?