1

I'm brand spanking new to taming the beast that is emacs. I'm using the built in "customize" feature (it has checkboxes and the like). However, when I save the changes, it does not prompt me where to save the .emacs init file. It saves it in a location I don't want, from which I had moved the emacs program upon installation.

PS any general tips are welcome. I am quite overwhelmed and hardly even know where to start!

  • I'd also like to know how to add a theme – Evan Adler Feb 10 '16 at 4:24
  • Ask one question per question - ask your theme question separately, please. – Drew Feb 10 '16 at 5:14
2
  1. In MS Windows (Control Panel > System > Advanced system settings > Environment Variables > User Variables), set environment variable HOME to the directory where you want to keep your init file, ~/.emacs. If HOME does not already exist, use Add to create it.

    (See the Emacs manual, node Init File, which you can get to using C-h r g init file) for alternative init file names and locations.)

    By default, Customize writes your customizations into your init file. But it is better to reserve your init file for Lisp code that you write yourself.

  2. You can make Customize write your customizations to another file, whose absolute file name is the value of variable custom-file. Just put this in your init file (~/.emacs):

    (setq custom-file  /your/location/to/your/custom/file/any-name.el)
    
  3. And in your init file somewhere after that, tell Emacs to load your custom-file:

    (load-file custom-file)
    
|improve this answer|||||
  • If HOME does exist it, there could be issues with the program that already set HOME and is using it. So hopefully, HOME does not exist. – Scooter Feb 10 '16 at 8:34
  • @Scooter: Yes, if HOME exists, then it might be a good idea to put your init file in that directory, without changing the variable value. – Drew Feb 10 '16 at 14:37

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.