Reputation: 1711
I'm having a problem while invoking emacs to eval some elisp from the windows powershell.It seems to be a problem with the usage of quotes, but I can't figure that out:
This is the command that I'm executing:
PS> emacs.exe --eval '(with-current-buffer "*scratch*" (insert "Hi"))'
Then emacs opens and I get the following message in the *Backtrace* buffer:
Debugger entered--Lisp error: (void-variable *scratch*)
(set-buffer *scratch*)
(save-current-buffer (set-buffer *scratch*) (insert Hi))
(with-current-buffer *scratch* (insert Hi))
eval((with-current-buffer *scratch* (insert Hi)))
command-line-1(("--eval" "(with-current-buffer *scratch* (insert Hi))"))
command-line()
normal-top-level()
Any help on how to run this correctly would be awesome.
Thanks
Upvotes: 0
Views: 535
Reputation: 1711
After playing a while with the quotes, I realized that I need to pass the emacs' escape character for the double quotes. So the command that finally worked for me is:
PS> emacs.exe --eval '(with-current-buffer \"*scratch*\" (insert \"Hi\"))'
Thanks everyone for your help.
Upvotes: 3