Can I move text from another application to the current Emacs buffer?

I want to create a command line application that can be used as follows:

$push_to_emacs_buffer "some text"

Then the current current Emacs will add some textto the current active buffer.

Any idea on how to achieve this?

+5
source share
1 answer

Try

emacsclient -e '(with-current-buffer (window-buffer (selected-window)) (insert "some text"))'

On Linux, push-to-emacs-bufferit can be implemented as follows:

#!/bin/sh

emacsclient -e "(with-current-buffer (window-buffer (selected-window)) \
                  (insert \"$@\"))"
+6
source

All Articles