【发布时间】:2013-04-05 03:08:18
【问题描述】:
我有一些这样的文字:
qwerty\tberty
merty\tserty
我想抓取制表符和行尾之间的文本 berty。然后显示它工作到缓冲区的末尾并在那里插入文本。
但是这段代码不起作用。有什么想法为什么不呢?
(defun do-test ()
"tester"
(interactive)
(goto-char (point-min))
(if (search-forward "qwerty" nil t)
(delete-char 1) ;;delete tab
(setq myStr (buffer-substring point end-of-line)) ;add text to variable
;goto end of buffer and insert text as demonstration it works
(goto-char (point-max))
(insert(myStr))
)
)
编辑:
抱歉,剪切和粘贴错误。应该是:
(if (search-forward "qwerty" nil t)
【问题讨论】:
-
“选项名称”是做什么用的?另外,请提供输入缓冲区内容和相关的所需输出缓冲区内容以了解问题所在。
-
@NicolasDudebout 抱歉,已删除选项名称 - 应该是 qwerty。示例缓冲区是上面的文本。