reddit / emacs

Will updating the version of Emacs installed on my computer cause my configuration file to be overridden, deleted, etc.?

AP145 · 2022-12-10 20:26
I am thinking of updating my version of Emacs installed on my computer, but I don't want anything to be changed on my configuration file. I am using Emacs on Windows; I haven't yet made the switch to GNU/Linux for various reasons. I installed Emacs using the standard installer provided on the GNU mirror; any update would also be installed using the installer as well.
CorysInTheHouse69 · 2022-12-10 20:29
No
anaumann · 2022-12-10 20:35
And to elaborate a bit on that, you can describe the variable `user-emacs-drectory` which tells emacs where your lisp files and, unless you're using the old-school `.emacs` file, your `init.el` are located.. That folder is most probably somewhere in your windows home(`C:\User\YourUser` or similar), so it's not part of the emacs installation itself.. Coming from a unix world, emacs tends to store all user-specific data in users' folders and not globally).
AP145 · 2022-12-10 21:32
And when it comes to actually updating Emacs, all I have to do is download the installer, run it, and then let the program do it's job, right? Since I already have an older version of Emacs installed, I am going to assume that it will be overridden by the new version. Is that a correct way of looking at things? Would I have to manually uninstall or delete the old version of Emacs?
anaumann · 2022-12-10 22:02
Unfortunately, it's not that easy to tell on Windows.. most of the time it works exactly like that, but not all of the time.. But then again: Because all your packages installed by emacs' package manager and your configuration reside in your "home" directory, it doesn't really matter than much.. Worst case: Everything's pointing to your updated emacs installation and you've wasted a bit of hard disk space to an unused emacs installation that's not used anymore.
AP145 · 2022-12-10 22:05
But overall, it won't really be a big deal if I upgrade, right? Nothing on my configuration file will change and none of the packages I have installed for Emacs will be changed as well. So, at worst, I will just have to uninstall an older version of Emacs when I update it?
anaumann · 2022-12-10 22:10
Pretty much, yes.. All your installed emacs packages are located in your user-emacs-directory as is, probably, your init.el.. So it won't be touched by the new emacs installation. It's up to you to make sure your packages work with the new version.
7890yuiop · 2022-12-11 05:15
Updating the installed Emacs version certainly shouldn't cause any part of your config to be overwritten. *Using* the updated version of Emacs might do. That would depend entirely on what your config does (as an example, some people have configs which automatically update ELPA packages), but at minimum you might expect the `custom-set-variables` section of your config to get written to automatically. Back up your config first, and you'll be fine.
AP145 · 2022-12-11 14:35
I am just curious, is there a reason why it isn't easier to update Emacs? On some other software I use, not necessarily text editors, when an update is available it will ask me if I want to update it and if I say yes then it just shuts down, does the update, and then the program restarts again. I don't have to worry about files being changed or deleted, etc. Is there any reason why Emacs doesn't work that way?
Awkward_Tradition · 2022-12-12 12:51
>I am just curious, is there a reason why it isn't easier to update Emacs? In Linux (and macos I think) you generally install and update programs with package managers. So for example "pacman -Syu" will update your OS and everything installed through pacman. I'm guessing they didn't care to implement a completely different update system just for the few windows users. Especially since you can now install it through wsl or chocolatey and get the same functionality. >I don't have to worry about files being changed or deleted, etc. You shouldn't, but if you want to be 110% sure create a separate directory for your personal config files and set it as the default directory or symlink those files to the default directory.