purcell / emacs.d

An Emacs configuration bundle with batteries included
BSD 2-Clause "Simplified" License
6.84k stars 2.05k forks source link

Customization lost when pulling #795

Closed flaviu-gostin closed 1 year ago

flaviu-gostin commented 2 years ago

Fantastic configuration! Thank you for sharing. One issue: Often when (Every time?) I pull new commits, the file "custom.el" on my disk gets overwritten and my customizations are lost. I can recover that file from a backup, but this has the side effect that it keeps the old value for the variable "package-selected-packages". I was wondering whether there was an easy solution to this, i.e. 1) allow "package-selected-packages" to be updated and 2) prevent loss of my customization? Thank you.

purcell commented 2 years ago

I don’t see this behaviour myself. custom.el is ignored in the configuration. Have you re-added and committed it in your fork?

flaviu-gostin commented 2 years ago

Thank you for replying. I haven't re-added custom.el to my fork. I also tried now to reproduce this behavior. I didn't succeed, which is embarrassing. My apologies. The problem should be somewhere else. I will pay more attention when/if it happens again.

purcell commented 2 years ago

No worries, don't feel bad for asking about this. Let me know if you figure out what was going on!

flaviu-gostin commented 2 years ago

Thanks. Will do!

flaviu-gostin commented 2 years ago

I would like to re-add and commit custom.el in order to keep track of my customization and be able to easily correct any accidental changes. Do you think that would be a bad idea for any reason? Thank you.

purcell commented 2 years ago

I would like to re-add and commit custom.el in order to keep track of my customization and be able to easily correct any accidental changes. Do you think that would be a bad idea for any reason? Thank you.

I think it's generally preferable to write your customization as code and put it somewhere else, but you could certainly remove custom.el from the .gitignore and commit it. You would need to make sure you regularly commit changes to avoid them getting lost.

dcorking commented 10 months ago

@flaviu-gostin I just spotted this old question. I am a fan of customize so I commit custom.el in my fork and it has worked well for me for several years. My only minor annoyance is that the list in the package-selected-packages variable is in an arbitrary order that can change when I add or remove a package, so git diff doesn't make it easy to spot what changed.