Say, I changed ~/.emacs, but I have another instances of emacs running. I believe unless I do something, they might change the config (because they have a stale notion of its contents), which in turn will result in losing the changes above. I can think of the following cases where emacs changes settings on its own:

  • installing packages
  • "easy" customization (M-x customize)
  • adding/removing agenda files (C-c [, C-c ])

How do I make it so that no changes is lost?

I don't want to use emacs server, since that supposedly means I have one frame (okay, not necessarily), one buffer list, and probably more. Or is this generally the best way to go about it after all?

  • you can do M-x load-file ~/.emacs . – djangoliv Jul 3 '20 at 10:00
  • @djangoliv Will that make emacs aware that the config has changed, and if it were to change the config it should use the new (current) version? – x-yuri Jul 3 '20 at 10:25
  • Emacs will simply reload the configuration as if it were restarting. – djangoliv Jul 3 '20 at 12:07
  • For clarity, that doesn't mean that any kind of 'reset' takes place. load-file will read and evaluate all of the code in the specified file, and that will happen "over the top" of whatever the current state was. The result depends on what kind code you've actually written or changed in your init file. (For example if you'd changed the default value of an existing defvar then evaluating that won't have an effect. If you'd changed the value used in a setq then it would have an effect.) – phils Jul 4 '20 at 0:05
  • You can also evaluate individual changes at run time. masteringemacs.org/article/evaluating-elisp-emacs is a good overview of the facilities. – phils Jul 4 '20 at 0:09

Your Answer

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

Browse other questions tagged or ask your own question.