如何在 elisp 中将缓冲区的当前行收集为字符串值?我可以做这个,
(let (p1 p2 myLine)
(setq p1 (line-beginning-position) )
(setq p2 (line-end-position) )
(setq myLine (buffer-substring-no-properties p1 p2))
)
但无论如何我可以在一行中做到这一点,
(with-current-buffer get-current-line)
Use thing-at-point http://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Contents.html:
(thing-at-point 'line t)
但请注意,这也会返回行末尾的任何换行符。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)