Hi, does anyone know how to run something like the following on a Windows machine with the DOS command line?
emacs -batch -l functions.el --eval '(run-function "argument")'
Thanks!
Hi, does anyone know how to run something 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!