문제

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