Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spacemacs overwrites all customizations on every startup #595

Closed
henrycrutcher opened this issue Feb 13, 2015 · 19 comments
Closed

spacemacs overwrites all customizations on every startup #595

henrycrutcher opened this issue Feb 13, 2015 · 19 comments
Labels

Comments

@henrycrutcher
Copy link

To repro:
use M-x customize-variable to set a variable
restart emacs
notice changes are gone

@syl20bnr
Copy link
Owner

These customizations should go at the end of your .spacemacs file. Can you verify that emacs correctly append your settings there ?

@syl20bnr
Copy link
Owner

@henrycrutcher I see the problem, I see what I can do to fix this.

@CestDiego
Copy link
Contributor

^ this works now?

@syl20bnr
Copy link
Owner

After reading again the issue I'm not sure I understood it well. Is the changes gone (not in the dotfile anymore) or is the changes overwritten ?

@henrycrutcher
Copy link
Author

I'll test it out and see how it goes -- Thanks!!!!

@henrycrutcher
Copy link
Author

I tried to customize smooth-scroll-margin to change the margin from 5 to 1, and customize said it was changed outside customize, and when I customized it, it worked for that session, but restarting emacs and customizing it again, the value was back to 5, as if I had never been there. If there any way to figure out where the change is happening?

@syl20bnr the changes do get saved in the .spacemacs -- they just get overridden after the customization is loaded -- here's the bottom of my .spacemacs

;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ac-ispell-requires 4)
'(ahs-case-fold-search nil)
'(ahs-default-range (quote ahs-range-whole-buffer))
'(ahs-idle-interval 0.25)
'(ahs-idle-timer 0 t)
'(ahs-inhibit-face-list nil)
'(ring-bell-function (quote ignore) t)
'(smooth-scroll-margin 1))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

@syl20bnr
Copy link
Owner

Thanks for the explanations. This is a flaw in the way spacemacs loads.
As a work around for now you can (setq smooth-scroll-margin 1) in your dotspacemacs/config instead.

@henrycrutcher
Copy link
Author

Thanks!!!

@cmccloud
Copy link
Contributor

@syl20bnr Is there any interest in a fix for this?

I was thinking that, rather than have spacemacs/config.el set the custom file, its location could be added as one of the default init variables in the dotspacemacs/init function.

The call to load the custom file could then be moved to either init.el or into spacemacs/setup-startup-hook.

@TheBB
Copy link
Collaborator

TheBB commented Oct 23, 2015

#3470 probably fixes this.

@calopter
Copy link

Is this the same issue? When I open the customize GUI via the major mode it says State: something in this group has been changed outside customize.

I can see the changes I had made reflected in my .spacemacs but they do not take effect.

@junebash
Copy link

junebash commented Nov 7, 2017

I am now having this same issue where every time I start Emacs, all settings in my .spacemacs file in the "custom-set variables" section are being removed.

@9mm
Copy link

9mm commented Jan 3, 2018

Same here, confused where I should put it

@dbmikus
Copy link

dbmikus commented Jun 15, 2018

I was having this issue because I was previously defining the custom-file in dotspacemacs/user-init and then loading it in dotspacemacs/user-config. I think I was doing this because of some weird interaction with layers before, but I think that problem is gone (or maybe it never existed)?

Now, I configure and then load the file in dotspacemacs/user-init. I was having the issue where my custom.el file was being overwritten whenever I updated packages and it went to write out the package-selected-packages variable. Putting both the custom file definition and loading in dotspacemacs/user-init appears to solve this problem.

Because of intricacy around how Spacemacs package upgrade, loading, and selection is defined, I think it might be helpful to make the custom-file definable through a Spacemacs variable in dotspacemacs/init.

@uberjay
Copy link

uberjay commented Jun 27, 2018

I've been having this problem off-and-on for a while now, although I haven't identified when it occurs. I've been running the develop branch for ~6 months now, and update my spacemacs repo/packages on a semi-regular basis. The variables I've customized (using the emacs customize facility) get blown away... sometimes, but not always when I restart emacs.

I'm running:

GNU Emacs 26.1 (build 1, x86_64-apple-darwin17.5.0, Carbon Version 158 AppKit 1561.4) of 2018-06-14

I don't have any special configuration regarding a custom-file -- it's stored at the end of my ~/.spacemacs.d/init.el file.

EDIT: As a random tidbit, ~/.spacemacs.d is a symlink to a version-controlled directory. Relevant? Perhaps!

@dbmikus
Copy link

dbmikus commented Jun 28, 2018

@uberjay: you should see if updating packages and restarting Emacs is the cause. If so, look at my post above yours and try moving the custom file configuration code in dotspacemacs/user-init.

@uberjay
Copy link

uberjay commented Jul 1, 2018

Thanks, that does appear to have fixed it. I mistakenly moved the whole dotspacemacs/emacs-custom-settings wrapper bits, which ended up causing duplicate custom-set-variables entries to get written out. After thinking about it, and realizing that I put the explicit load of custom settings in my user-init function (duh! :), I removed the dotspacemacs bits, and everything seems to be happy again.

Thanks for the tip!

@EwanDawson
Copy link

EwanDawson commented Jan 15, 2019

This issue definitely isn't fixed. I set a bunch of customizations using customize, which then appeared in dotspacemacs/emacs-custom-settings, in the call to custom-set-variables. These settings persisted for a while. However, I just restarted emacs, and these customizations have been lost.
(Running Spacemacs 0.300.0@25.3.1)

@paulodiniz
Copy link
Contributor

Same here. I have been having problems switching themes as for the background seemed to always stay white.

The problem was the custom-set-faces which always set the background to #FFFFFF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests