Emacsclient -eval "(insert \" something \ ")" does not work for me

I recently upgraded to Ubuntu 10.04, which comes with Emacs 23. I need Jabref to click links to Emacs.

However, despite the fact that I installed the Jabref plugin for entering quotes through emacsclient, it does not work.

I checked my testing and read part of Emacs Lisp Intro.

Some commands work, for example, if I type (in the console):

emacsclient --eval "(switch-to-buffer \"*sratch*\")" 

emacs windows switch to this buffer. However, if I issue the insert command:

  emacsclient --eval "(insert \"do you see me?\")" 

text is not inserted into the current buffer.

Does Emacs 23 affect the insert?

+4
source share
2 answers

Yo is inserted into the server buffer, you most likely want:

 emacsclient --eval '(with-current-buffer "*scratch*" (insert "do you see me?"))' 
+4
source

Emacs23 will change something about emacsclient and the server.

The expression is evaluated in the "* server *" buffer (with master space) ... Thus, you must change the buffer before inserting:

  emacsclient --eval "(with-current-buffer \"*scratch*\" (insert \"foo\"))" 
+2
source

Source: https://habr.com/ru/post/1309319/


All Articles