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.
我想制作一个可以像这样使用的命令行应用程序:
$push_to_emacs_buffer "some text"
然后当前运行的 Emacs 将追加some text到它当前的活动缓冲区中。
some text
关于如何实现这一目标的任何想法?
尝试
emacsclient -e '(with-current-buffer (window-buffer (selected-window)) (insert "some text"))'
在 Linux 上,push-to-emacs-buffer可以这样实现:
push-to-emacs-buffer
#!/bin/sh emacsclient -e "(with-current-buffer (window-buffer (selected-window)) \ (insert \"$@\"))"