reddit / emacs

Emacs finally got a command line switch to set user-emacs-directory

nv-elisp · 2022-06-09 01:04
Available recently in Emacs 29. This makes testing alternative init files and debugging much easier. Obviates the need for tools like chemacs. https://git.savannah.gnu.org/cgit/emacs.git/log/?qt=grep&q=init-directory
Danrobi1 · 2022-06-09 01:14
Thanks for sharing
FluentFelicity · 2022-06-09 04:18
This is great!!
takutekato · 2022-06-09 08:18
Awesome.
xircon · 2022-06-09 11:47
Brill, going to test this tonight, it should enable me to get rid of chemacs and a few "codges" I use :D
Psionikus · 2022-06-09 12:22
How is this different than the `--user` switch in 28? Not rhetorical. Haven't tried either yet. [positron/elisp-repo-kit/]$ /usr/bin/env emacs --version GNU Emacs 28.1 Copyright (C) 2022 Free Software Foundation, Inc. GNU Emacs comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of GNU Emacs under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. [positron/elisp-repo-kit/]$ /usr/bin/env emacs --help | rg user --user, -u USER load ~USER/.emacs instead of your own
nv-elisp · 2022-06-09 12:39
user-emacs-directory is not set with - - user. Try it out with native comp enabled and see where your eln-cache ends up.
Desmesura · 2022-06-09 14:32
Also to restart! `M-x restart-emacs`. Better late than never
WallyMetropolis · 2022-06-09 14:47
Very cool. I used chemacs2 when migrating from Spacemacs to vanilla (and also to just poke around at Doom) and was grateful that it existed. If this works well, it will prove to be a great new feature. Hopefully "restart with the same flags" will also work.
vfclists · 2022-06-09 15:35
It would be interesting to know what internal design made it so difficult to implement over the years, or was it just not a priority for the developers?
nv-elisp · 2022-06-09 15:51
You're welcome to check out the linked commit which added it. I don't think difficulty was a factor. Most of the diff is moving some pre-existing native comp code a little later in the startup process. The core of the change is a few lines. Probably moreso low priority and/or being convinced of the desire for such a switch. That and someone (Lars in this case) had to step up and make the changes.
dougie-io · 2022-06-09 17:17
Finally able to reboot my operating system.
github-alphapapa · 2022-06-10 06:44
Wow, finally! And just when I've gotten the bugs ironed out of [with-emacs.sh](https://github.com/alphapapa/with-emacs.sh) and [makem.sh](https://github.com/alphapapa/makem.sh) related to Emacs 28's changes. Well, pre-29 versions will still be around for a long time, so `with-emacs.sh` will remain useful, but it will be nice to have support for this integrated into Emacs. I remember the bug report asking for it, which was unceremoniously closed, to my disappointment. I wonder what changed their minds... Edit: Yes, see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539 and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16242. Anyway, I'm glad the stars finally aligned for this. Thanks for handling it, Lars.