我有下面的文本(与实际的选项卡中,而不是\ t),我需要在“描述”后面的选项卡后,并获取所有文本直到缓冲区结束。elisp错误的类型参数:整数或标记-p错误
key1\tval1
key2\tval2
key3\tval3
Description\tlots and lots and lots and lots and lots lots
and lots and lots and lots and lots lots and lots and lots and
lots and lots lots and lots and lots and lots and lots lots and
lots lots and lots and lots and lots and lots lots and lots lots
and lots and lots and lots and lots lots and lots lots and lots
and lots and lots and lots lots and lots lots and lots and lots
and lots and lots lots and lots lots and lots and lots and lots
and lots lots and lots lots and lots and lots and lots and lots
这里是口齿不清功能:
(defun find-description()
(interactive)
(goto-char (point-min))
(when (re-search-forward "Description\t")
(setq myStr (buffer-substring (point) (end-of-line)))
(goto-char (point-max))
(insert "\n\n\ndescription=")
(insert myStr)
)
)
而这种失败的(setq符合错误:
Wrong type argument: integer-or-marker-p, nil
我认为正则表达式搜索后,该点会刚刚在说明\ t之后,为什么不设置变量的工作?
'行结束符* *移动*到行尾而不是返回它。你想使用'line-end-position'代替。 – Stefan