Inspired by the question Launch emacs with ediff-files (of ediff-directories) from command line and the answer https://emacs.stackexchange.com/a/3623/2609, I tried

emacs --eval '(set-background-color "green")'

from an MS DOS prompt without sucess. What is wrong with this? I also tried with the argument -Q but it doesn't change. I should mention that it works well if I execute it from an eshell inside emacs.


DOS does not recognize ' ' as quotes.

You will have to use the following:

emacs --eval "(set-background-color \"green\")"

Powershell works a little closer to what you expect:

emacs --eval '(set-background-color \"green\")'

But it too requires \ before the " to properly escape them.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.