要清理一些文件,我需要执行一系列步骤,这些步骤的 emacs 代码是
(query-replace "," " " nil
(if (and transient-mark-mode mark-active)
(region-beginning))
(if (and transient-mark-mode mark-active)
(region-end)))
(query-replace "1 1/4" "1.25" nil
(if (and transient-mark-mode mark-active)
(region-beginning))
(if (and transient-mark-mode mark-active)
(region-end)))
(query-replace-regexp "[0-9][0-9][0-9]V[0-9][0-9][0-9] " "" nil
(if (and transient-mark-mode mark-active)
(region-beginning))
(if (and transient-mark-mode mark-active)
(region-end)))
(还有更多,但你明白了)有没有办法将所有这些命令放在一个文件中并运行它们?或者也许在 lisp 文件中为它们分配一个名称并按名称运行它们?