【发布时间】:2012-12-04 15:09:43
【问题描述】:
这与 Emacs: regular expression replacing to change case
我的另一个问题是我需要编写搜索替换脚本,但 "\,()" 解决方案仅在以交互方式使用 (emacs 24.2.1) 时才有效(对我而言)。在脚本中它给出了错误:“在替换文本中无效使用\'”。
我通常会在需要时将“执行替换”写入某些要加载的文件。比如:
(执行-替换"<\\([^>]+\\)>" "<\\,(downcase \1)>" t t nil 1 nil (point-min) (point-max))
应该可以调用一个函数来生成替换(pg 741 of the emacs lisp manual),但是我尝试了以下的许多变体,但没有运气:
(defun myfun ()
(downcase (match-string 0)))
(perform-replace "..." (myfun . ()) t t nil)
谁能帮忙?
【问题讨论】: