标签: emacs elisp
如何在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)
答案 0 :(得分:31)
使用thing-at-point:
thing-at-point
(thing-at-point 'line t)
但请注意,这也会返回该行末尾的任何换行符。