Вопрос

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

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top