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 forgets all customizations made through customize / org-customize #10504

Closed
tko opened this issue Mar 20, 2018 · 13 comments
Closed

spacemacs forgets all customizations made through customize / org-customize #10504

tko opened this issue Mar 20, 2018 · 13 comments
Assignees
Labels
- Bug tracker - Customize Fixed in develop stale marked as a stale issue/pr (usually by a bot)

Comments

@tko
Copy link
Contributor

tko commented Mar 20, 2018

Description :octocat:

spacemacs forgets all customizations made through customize / org-customize

Reproduction guide 🪲

  • Start Emacs
  • Customize some options, say org-capture-templates or org-modules; remember to Apply and Save changes
  • Restart Emacs
  • (verify the customizations are present in dotspacemacs/emacs-custom-settings and the variables have expected values)
  • Update Packages (best guess of triggering the problem)
  • Restart Emacs

Observed behaviour: 👀 💔
The customizations have disappeared without a trace from custom-set-variables in dotspacemacs/emacs-custom-settings. Especially with complex variables like org-templates this may be a loss of non-trivial effort in fine tuning.

The only(?) variable left is package-selected-packages which seems completely redundant overall as spacemacs is managing the packages.

Expected behaviour: ❤️ 😄
Everything working as customized. No notable data loss.

System Info 💻

  • OS: darwin
  • Emacs: 25.3.3
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 6868551)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(helm emacs-lisp neotree
      (auto-completion :variables auto-completion-enable-help-tooltip t)
      (colors :variables colors-colorize-identifiers 'variables)
      dash docker
      (evil-goggles :variables evil-goggles-duration 0.1)
      (finance :variables ledger-default-date-format "%Y-%m-%d")
      git graphviz html imenu-list javascript lua
      (org :variables org-agenda-files
           '("~/org")
           org-enable-reveal-js-support t)
      (osx :variables osx-use-option-as-meta nil osx-right-option-as 'meta osx-right-command-as 'super)
      outshine
      (plantuml :variables plantuml-jar-path "/usr/local/Cellar/plantuml/1.2018.1/libexec/plantuml.jar")
      python react restclient rust shell-scripts sql syntax-checking typescript version-control yaml)
  • System configuration features: NOTIFY ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS
@smile13241324
Copy link
Collaborator

I can reproduce this issue on develop with emacs 25.3.1. After updating packages all customisations are gone, except the list of selected packages. For now I have no clue what could cause this behaviour, but it is pretty annoying for anyone using the old "emacs customisation" interface.

@kini
Copy link
Contributor

kini commented Apr 9, 2018

What's "old" about the customize interface? Isn't it the recommended way of configuring most packages?

This seems like a really severe bug. It's already bitten me several times and is more than "pretty annoying" in my opinion. I'd appreciate it if my text editor did not delete my data!

@rpls
Copy link
Contributor

rpls commented Jun 18, 2018

I can reproduce this with emacs 25.3.2 on f1f8db0

@letheed
Copy link

letheed commented Jun 20, 2018

Just moved to develop from stable and this is a severe bug. I have a back up of my dotspacemacs but still.

@magicBeast
Copy link

Any news on this - just found out about it when my custom templates all disappeared? :-(

@mtdaly
Copy link

mtdaly commented Nov 19, 2018

I was able to reproduce this with gnu emacs 27.0.50 on develop: d912b54

@ksjogo
Copy link
Contributor

ksjogo commented Dec 12, 2018

Having the same problem on emacs develop and spacemacs develop, though I have a slightly different repro case.
It only happens, when a new package dependency is added to spacemacs and then I restart spacemacs. Not when using package-install while running.
I assume the package dependencies might be checked before custom is load and thus are not saved?

@ksjogo
Copy link
Contributor

ksjogo commented Dec 12, 2018

Some workaround: Add
(dotspacemacs/emacs-custom-settings)
Just below the custom blocks.
So:

(defun dotspacemacs/emacs-custom-settings ()
.......
)

(dotspacemacs/emacs-custom-settings)

@kini
Copy link
Contributor

kini commented Jan 12, 2019

Thanks, that workaround seems to work for me.

@bmag
Copy link
Contributor

bmag commented Feb 18, 2019

Should be fixed by #11994. The workaround works in most cases, but in a case where a customized variable force loads a library it would cause an error (e.g. see #9736). The new fix should be safe.

For completeness, here's a repro guide for the bug:

  • customize fill-column to 90 and save for future sessions (e.g. SPC SPC customize-variable RET fill-column RET)
  • add ahg to dotspacemacs-additional-packages and delete its folder (if already installed) from elpa directory
  • quit emacs
  • tail -n 20 ~/.spacemacs.d/init.el
    • observe: output includes fill-column customization
  • start emacs
  • tail -n 20 ~/.spacemacs.d/init.el
    • observe: output doesn't include fill-column customization, the only setting is package-selected-packages
  • quit emacs
  • tail -n 20 ~/.spacemacs.d/init.el
    • observe: output doesn't include fill-column customization, the only setting is package-selected-packages, original customizations are lost.

Cause of the bug:

  • spacemacs loads ~/.spacemacs.d/init.el and the original dotspacemacs/emacs-custom-settings function with the original custom settings, but doesn't call the function yet.
  • spacemacs enables the advice to write custom settings into ~/.spacemacs.d/init.el
  • spacemacs installs the new package, which triggers overwriting the custom settings in ~/.spacemacs.d/init.el. The original custom settings weren't loaded yet, so they are not written to the file.
  • spacemacs loads the original custom settings by calling dotspacemacs/emacs-custom-settings

I solved the bug by moving "enable the advice" step to after dotspacemacs/emacs-custom-settings is called.

@syl20bnr
Copy link
Owner

Fix merged, please verify.

@tko
Copy link
Contributor Author

tko commented Feb 19, 2019

I can verify customizations persisting through additional package update steps as bmag noted above #10504 (comment)

Starting with .spacemacs file with no customizations and going through the steps I get a dotspacemacs/emacs-custom-settings added in the file and its contents remain stable between restarts. Only fill-column is listed in the customizations; I'm not seeing package-selected-packages but I'd consider that appropriate as I haven't installed packages outside layers and dotspacemacs-additional-packages.

@github-actions
Copy link

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!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Bug tracker - Customize Fixed in develop stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

10 participants