tags:

views:

107

answers:

2

I recently upgraded to Ubuntu 10.04 which comes with Emacs 23. I need Jabref to push citations to Emacs.

However, despite I installed the Jabref plugin to push citations through emacsclient, it's not working.

I did my testing, and read some of the Emacs Lisp Intro.

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

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

the emacs windows switches to that buffer. However if I issue an insert command:

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

no text is inserted in the current buffer.

Does Emacs 23 changed something about insert?

A: 

Emacs23 change something about emacsclient and server.

The expression is evaluated in the buffer " *server*" (with a leading space)... So you have to change buffer before inserting:

  emacsclient --eval "(with-current-buffer \"*scratch*\" (insert \"foo\"))"
Rémi
+1  A: 

Yo are inserting in server buffer, you most likely want:

emacsclient --eval '(with-current-buffer "*scratch*" (insert "do you see me?"))'
Jürgen Hötzel
Thanks! I spent a while reading Emacs Lisp Intro, and while testing the buffer-name function, saw the " *server*" name.So I think I should reformulate my question into a harder one: Could I insert the text into the "buffer" I'm editing on the current frame? Should I write this as separate question and close this one?
manu
I found it:(with-current-buffer (window-buffer) (insert "I do see you!"))
manu