当我右键单击文件管理器中的文件以使用 Emacs 打开文档时,我想开始执行以下功能(从Emacs 中的句子后用两个替换一个空格)运行。
(defun space12 ()
(interactive)
(save-excursion
(goto-char (point-min))
(while (re-search-forward "\\. \\([^ ]\\)" nil t)
(replace-match ". \\1" t))))
这将转换". "
为". "
不增加现有两个空间出现的空间。
如何才能做到这一点。我想将 (space12) 添加到 init.el 但它似乎是在加载文档之前加载的。
样本输入:
This is for test. This is second line with only one space at start. This is third line which already has 2 spaces before it. End of document.