Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我使用emacsclient --eval '(current-buffer)'它时,它会返回*server*而不是current-bufferon emacs。我可以*server*使用--eval命令插入和修改,但有没有办法知道让它插入到真正的当前缓冲区?有没有办法传递一个类似的字符串#<buffer index.html>并将它变成一个缓冲区对象?
emacsclient --eval '(current-buffer)'
*server*
current-buffer
--eval
#<buffer index.html>
试试(window-buffer (selected-window))。例如,
(window-buffer (selected-window))
emacsclient --eval '(with-current-buffer (window-buffer (selected-window)) (insert "foo"))'