Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to set a customizable variable when I start Emacs? E.g. I have a project name variable, which I usually set interactively using M-x customize-variable, but I'd like to set it already when starting Emacs. I.e. so I can choose a project from the command line.

share|improve this question

1 Answer 1

up vote 7 down vote accepted

You can run

emacs --eval '(setq variable-name value)'

to do this. Or you could edit your settings file in such a way that it reads the customization from some environment variable, and set that on the command line.

share|improve this answer
    
+1 for the environment variable! Can you give a complete example please? –  Dror Sep 18 '13 at 18:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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