开发者

executing emacs -batch on MS-DOS

does anyone know how to run somet开发者_运维知识库hing like the following on a Windows machine with the DOS command line?

emacs -batch -l functions.el --eval '(run-function "argument")'

Thanks!


This mostly works with official binaries for 23.1, but there are some quirks with command-line argument parsing. Unlike sh or friends, CMD.EXE doesn't do much in the way of command-line parsing, so this is left to the application on windows.

Emacs.exe doesn't like single quotes:

C:\emacs-23.1\bin>emacs -batch --eval '(message "Foo!")'
End of file during parsing

Unsurprisingly, it doesn't like quotes embedded in the command either:

C:\emacs-23.1\bin>.\emacs -batch --eval "(message "Foo!")"
Symbol's value as variable is void: Foo!

Fortunately escaping with '\' seems to work OK:

C:\emacs-23.1\bin>.\emacs -batch --eval "(message \"Foo!\")"
Foo!

Hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜