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
How to Avoid dotspacemacs/emacs-custom-settings? #7891
Comments
Yeah this is dangerously broken. When I reboot Emacs, more often than not it will ask to save |
The code of It then deletes the custom section from your dotfile and writes the new one there. In fact, spacemacs--custom-file is just a temporary cache location (which needs to match Suggestion to make everyone happy: Introduce a new variable to control where dotspacemacs/emacs-custom-settings is written. Put the variable in the Give the variable this default value: That string would be a value with special meaning which means what it does today: Find the dotspacemacs file wherever it is, and use that. Personalized value example: This would tell it to write to a separate file instead of your dotspacemacs file. And to load from that separate file when it restores itself. This way we can still have the advantages of the recent Spacemacs update which wraps the custom settings (great for being able to control exactly when custom settings get applied). But we can also choose where to save it all. It's going to require some rewrites of |
I propose to disable the auto-rewrite of customize variables when the |
Oh god yes, this is driving me crazy. One out every two emacs restarts all my custom settings are gone! And even when they are in the custom-file, emacs doesn't care and doesn't load them. |
@mkaito will take care of this tonight, at least to disable the automatic write to dotfile if the user set their own location. Is that your case ? |
I had two separate issues.
1. Emacs was not loading the customized variables and faces.
2. When saving customized variables, they would sometimes get written to
`.cache/.custom-settings`, and sometimes to the dotfile. Sometimes, nowhere.
They are both probably sympthoms of the same problem, but customize
internals are a mystery to me, so what do I know.
I'm going to go out on a limb and say specifying a `custom-file` that is
not the dotfile might fix both of these.
Sylvain Benner <notifications@github.com> writes:
… @mkaito will take care of this tonight, at least to disable the automatic write to dotfile if the user set their own location. Is that your case ?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#7891 (comment)
--
BOFH excuse #250:
Program load too heavy for processor to lift.
|
|
I did define I'm not entirely sure how to reproduce any of this. I haven't tried a "clean" installation. |
Ahah sorry for the wrong numbers, 3 is for the first point. Ok so if you modify the custom file then it should be fixed when I push the deactivation of auto-rewrite. |
I actually had the traditional custom-file snipped in my
`spacemacs/user-config` for a day or two, and that seems to have fixed
things, somehow. I'll test again with your fixes.
```
(setq custom-file "/somewhere/thats/not/the/dotfile")
(load custom-file)
```
Sylvain Benner <notifications@github.com> writes:
… Ahah sorry for the wrong numbers, 3 is for the first point.
Ok so if you modify the custom file then it should be fixed when I push the deactivation of auto-rewrite.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#7891 (comment)
--
BOFH excuse #442:
Trojan horse ran out of hay
|
I have a fix pending, I'll push it soon. Note: with this fix |
@syl20bnr Sooooo... When is the custom-file fix coming out? And should we use this standard pattern... ;; in dotspacemacs/user-init
(setq custom-file "/somewhere/thats/not/the/dotfile")
(load custom-file) Or this... ;; in dotspacemacs/user-init
(setq custom-file "/somewhere/thats/not/the/dotfile") |
Sorry for the late push, I finally pushed it (3 weeks later!!): 6212795 If you define your own |
Confirmed it's working in develop. |
See syl20bnr/spacemacs#7891 Should get fixed by default in a later version of spacemacs.
I am not sure if this is the correct issue to comment on, but even on HEAD I frequently see my spacemacs/emacs-custom-settings function get completely broken by spacemacs. Typically after I update packages or do some other major change it writes to my .spacemacs file writing only the beginning but not the end of this function, destroy information and leaving my .spacemacs invalid. Is this still known to be happening? Should I simply consider this deprecated and set custom-file instead? |
in order to effectively track dotfiles with git. Ref: syl20bnr/spacemacs#7891 Ref: https://emacs.stackexchange.com/questions/34092/how-do-i-move-custom-commands-into-a-separate-file-and-include-them-in-spacema
Finally possible thanks to: syl20bnr/spacemacs#7891
I'm confused. It used to be that So now I have them both as a top level, and inside that function. Which one is correct? Should I delete the one at the top level, and only keep them inside the Why has it moved to a function now? |
This is a side-effect when changing branch, keep the one encapsulated in |
I've set my custom file to be (setq custom-file "~/.emacs.d/.cache/.custom-settings")
(load custom-file) That file already existed there and it seems to contain the exact same things as I get that all my custom settings will be lost if I do a |
@syl20bnr Would that also work if I use the config on installs that use mainline? I share my config file on a few computers, and some are on develop (because it fixes issues specific to their environment), and others are on mainline. Thanks |
I'm afraid that it won't work you'll get the duplicated settings over
and over again. But they can co-exist.
Actually I'm not happy with this solution, I wanted to keep the dotfile
in one-piece no matter what but I guess we need to make an exception for
emacs custom settings and create a second file for them. This has been
asked for for a long time and it seems to be the best trade off.
"Didier A." <notifications@github.com> writes:
… @syl20bnr Would that also work if I use the config on installs that use mainline?
I share my config file on a few computers, and some are on develop (because it fixes issues specific to their environment), and others are on mainline.
Thanks
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#7891 (comment)
|
So, I decided to move all my spacemacs to develop, to keep them more in sync that way. One last question though, it does seem that the It kinda renders custom settings useless in this case. Is there a way to maintain them in such scenarios? Thanks |
- remove dotspacemacs/emacs-custom-settings - set custom-file in dotspacemacs/user-init to ~/.emacs.d/.cache/.custom-settings See syl20bnr/spacemacs#7891 (comment)
- remove dotspacemacs/emacs-custom-settings - set custom-file in dotspacemacs/user-init to ~/.emacs.d/.cache/.custom-settings See syl20bnr/spacemacs#7891 (comment)
- remove dotspacemacs/emacs-custom-settings - set custom-file in dotspacemacs/user-init to ~/.emacs.d/.cache/.custom-settings See syl20bnr/spacemacs#7891 (comment)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
Hey team, I ran into this issue this morning (spacemacs develop branch, emacs 27.2) and I fixed it with the "manual download of |
Finally possible thanks to: syl20bnr/spacemacs#7891
I mentioned this in a closed thread but thought it would be better to open a new issue instead.
Until recently I took advantage of
custom-file
to write custom configurations (custom-set-variables
) to an ignored file in an effort to avoid code being added to my configuration automatically as I store my configuration in version control and I don't use Emacs' customize UI.There was a recent update in develop where Spacemacs is now writing things to my configuration automatically in the form of
dotspacemacs/emacs-custom-settings
. I do not want this behavior and would like for this to be turned off, but there is no way to do that. Even if I remove the offending code, when I use the Update Packages feature of Spacemacs, that code gets injected back automatically.The text was updated successfully, but these errors were encountered: