* ~/.emacs vs ~/.emacs.d/init.el. @ 2020-12-13 9:00 Hongyi Zhao 2020-12-13 9:06 ` Christopher Dimech ` (2 more replies) 0 siblings, 3 replies; 23+ messages in thread From: Hongyi Zhao @ 2020-12-13 9:00 UTC (permalink / raw) To: help-gnu-emacs Hi, As far as the initialization file is concerned, which is more preferable,~/.emacs or ~/.emacs.d/init.el? Regards -- Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com> Theory and Simulation of Materials Hebei Polytechnic Vocational and Technical University NO. 552 North Gangtie Road, Xingtai, China ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 9:00 ~/.emacs vs ~/.emacs.d/init.el Hongyi Zhao @ 2020-12-13 9:06 ` Christopher Dimech 2020-12-13 10:09 ` Yuri Khan 2020-12-13 19:12 ` Emanuel Berg via Users list for the GNU Emacs text editor 2 siblings, 0 replies; 23+ messages in thread From: Christopher Dimech @ 2020-12-13 9:06 UTC (permalink / raw) To: Hongyi Zhao; +Cc: help-gnu-emacs You can have your own set of files for emacs customisation, then use ~/.emacs or ~/.emacs.d/init.el to load them. It would give you clear distinction between your customisation and customizations that emacs itself can generate. Using ~/.emacs is somewhat easier because it is also the location of your ".bashrc". C* > Sent: Sunday, December 13, 2020 at 10:00 AM > From: "Hongyi Zhao" <hongyi.zhao@gmail.com> > To: help-gnu-emacs@gnu.org > Subject: ~/.emacs vs ~/.emacs.d/init.el. > > Hi, > > As far as the initialization file is concerned, which is more > preferable,~/.emacs or ~/.emacs.d/init.el? > > Regards > -- > Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com> > Theory and Simulation of Materials > Hebei Polytechnic Vocational and Technical University > NO. 552 North Gangtie Road, Xingtai, China > > ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 9:00 ~/.emacs vs ~/.emacs.d/init.el Hongyi Zhao 2020-12-13 9:06 ` Christopher Dimech @ 2020-12-13 10:09 ` Yuri Khan 2020-12-13 13:50 ` Hongyi Zhao 2020-12-13 19:12 ` Emanuel Berg via Users list for the GNU Emacs text editor 2 siblings, 1 reply; 23+ messages in thread From: Yuri Khan @ 2020-12-13 10:09 UTC (permalink / raw) To: Hongyi Zhao; +Cc: help-gnu-emacs On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > As far as the initialization file is concerned, which is more > preferable,~/.emacs or ~/.emacs.d/init.el? If you are choosing between these two, ~/.emacs.d/init.el is preferable. Because then you can put the whole .emacs.d into version control separately from your home directory. However keep in mind that Emacs 27 adds support for XDG-style configuration directory, ~/.config/emacs/, which gives you the same abilities as ~/.emacs.d with an added benefit of less clutter in your home directory. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 10:09 ` Yuri Khan @ 2020-12-13 13:50 ` Hongyi Zhao 2020-12-13 13:56 ` Tim Visher ` (2 more replies) 0 siblings, 3 replies; 23+ messages in thread From: Hongyi Zhao @ 2020-12-13 13:50 UTC (permalink / raw) To: Yuri Khan; +Cc: help-gnu-emacs On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> wrote: > > On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > As far as the initialization file is concerned, which is more > > preferable,~/.emacs or ~/.emacs.d/init.el? > > If you are choosing between these two, ~/.emacs.d/init.el is > preferable. Because then you can put the whole .emacs.d into version > control separately from your home directory. > > However keep in mind that Emacs 27 adds support for XDG-style > configuration directory, ~/.config/emacs/, which gives you the same > abilities as ~/.emacs.d with an added benefit of less clutter in your > home directory. I've tried the following based on your above notes, but it seems that emacs doesn't pick up the initialization file located under ~/.config/emacs/ automatically. $ mv .emacs.d/init.el ~/.config/emacs/ Any hints for this problem? Regards, -- Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com> Theory and Simulation of Materials Hebei Polytechnic Vocational and Technical University NO. 552 North Gangtie Road, Xingtai, China ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 13:50 ` Hongyi Zhao @ 2020-12-13 13:56 ` Tim Visher 2020-12-13 13:58 ` 2QdxY4RzWzUUiLuE 2020-12-13 14:06 ` Perry Smith 2 siblings, 0 replies; 23+ messages in thread From: Tim Visher @ 2020-12-13 13:56 UTC (permalink / raw) To: Hongyi Zhao; +Cc: help-gnu-emacs, Yuri Khan On Sun, Dec 13, 2020 at 8:51 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> wrote: > > > > On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > > As far as the initialization file is concerned, which is more > > > preferable,~/.emacs or ~/.emacs.d/init.el? > > > > If you are choosing between these two, ~/.emacs.d/init.el is > > preferable. Because then you can put the whole .emacs.d into version > > control separately from your home directory. > > > > However keep in mind that Emacs 27 adds support for XDG-style > > configuration directory, ~/.config/emacs/, which gives you the same > > abilities as ~/.emacs.d with an added benefit of less clutter in your > > home directory. > > I've tried the following based on your above notes, but it seems that > emacs doesn't pick up the initialization file located under > ~/.config/emacs/ automatically. > > $ mv .emacs.d/init.el ~/.config/emacs/ > Any hints for this problem? > You may find this section in the manual helpful. https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html#Find-Init My two guesses are: More likely: You still have one of However ~/.emacs.d, ~/.emacs, and ~/.emacs.el are always preferred if they > exist, which means that you must delete or rename them in order to use the > XDG location. Less likely: You have XDG_CONFIG_HOME set somewhere in your environment to something other than ~/.config. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 13:50 ` Hongyi Zhao 2020-12-13 13:56 ` Tim Visher @ 2020-12-13 13:58 ` 2QdxY4RzWzUUiLuE 2020-12-13 14:38 ` Hongyi Zhao 2020-12-13 14:06 ` Perry Smith 2 siblings, 1 reply; 23+ messages in thread From: 2QdxY4RzWzUUiLuE @ 2020-12-13 13:58 UTC (permalink / raw) To: help-gnu-emacs On 2020-12-13 at 21:50:37 +0800, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> wrote: > > > > On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > > As far as the initialization file is concerned, which is more > > > preferable,~/.emacs or ~/.emacs.d/init.el? > > > > If you are choosing between these two, ~/.emacs.d/init.el is > > preferable. Because then you can put the whole .emacs.d into version > > control separately from your home directory. > > > > However keep in mind that Emacs 27 adds support for XDG-style > > configuration directory, ~/.config/emacs/, which gives you the same > > abilities as ~/.emacs.d with an added benefit of less clutter in your > > home directory. > > I've tried the following based on your above notes, but it seems that > emacs doesn't pick up the initialization file located under > ~/.config/emacs/ automatically. > > $ mv .emacs.d/init.el ~/.config/emacs/ > > Any hints for this problem? Try removing or renaming ~/.emacs.d, the existence of which might be fooling emacs into *not* searching for ~/.config/emacs. For reference, see: https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 13:58 ` 2QdxY4RzWzUUiLuE @ 2020-12-13 14:38 ` Hongyi Zhao 2020-12-13 14:44 ` Tim Visher 2020-12-13 14:52 ` 2QdxY4RzWzUUiLuE 0 siblings, 2 replies; 23+ messages in thread From: Hongyi Zhao @ 2020-12-13 14:38 UTC (permalink / raw) To: help-gnu-emacs On Sun, Dec 13, 2020 at 9:59 PM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote: > > On 2020-12-13 at 21:50:37 +0800, > Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> wrote: > > > > > > On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > > > > As far as the initialization file is concerned, which is more > > > > preferable,~/.emacs or ~/.emacs.d/init.el? > > > > > > If you are choosing between these two, ~/.emacs.d/init.el is > > > preferable. Because then you can put the whole .emacs.d into version > > > control separately from your home directory. > > > > > > However keep in mind that Emacs 27 adds support for XDG-style > > > configuration directory, ~/.config/emacs/, which gives you the same > > > abilities as ~/.emacs.d with an added benefit of less clutter in your > > > home directory. > > > > I've tried the following based on your above notes, but it seems that > > emacs doesn't pick up the initialization file located under > > ~/.config/emacs/ automatically. > > > > $ mv .emacs.d/init.el ~/.config/emacs/ > > > > Any hints for this problem? > > Try removing or renaming ~/.emacs.d, the existence of which might be > fooling emacs into *not* searching for ~/.config/emacs. For reference, > see: > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html > Currently, the ~/.emacs.d directory is used by emacs to store many of the user data as shown below: $ ls ~/.emacs.d/ auto-save-list cnfonts eaf elpa init.el network-security.data rime url So, if I removed/deleted this folder, then where should I put the emacs' user data? Regards -- Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com> Theory and Simulation of Materials Hebei Polytechnic Vocational and Technical University NO. 552 North Gangtie Road, Xingtai, China ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 14:38 ` Hongyi Zhao @ 2020-12-13 14:44 ` Tim Visher 2020-12-13 14:52 ` 2QdxY4RzWzUUiLuE 1 sibling, 0 replies; 23+ messages in thread From: Tim Visher @ 2020-12-13 14:44 UTC (permalink / raw) To: Hongyi Zhao; +Cc: help-gnu-emacs On Sun, Dec 13, 2020 at 9:39 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > On Sun, Dec 13, 2020 at 9:59 PM <2QdxY4RzWzUUiLuE@potatochowder.com> > wrote: > > > > On 2020-12-13 at 21:50:37 +0800, > > Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> > wrote: > > > > > > > > On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> > wrote: > > > > > > > > > As far as the initialization file is concerned, which is more > > > > > preferable,~/.emacs or ~/.emacs.d/init.el? > > > > > > > > If you are choosing between these two, ~/.emacs.d/init.el is > > > > preferable. Because then you can put the whole .emacs.d into version > > > > control separately from your home directory. > > > > > > > > However keep in mind that Emacs 27 adds support for XDG-style > > > > configuration directory, ~/.config/emacs/, which gives you the same > > > > abilities as ~/.emacs.d with an added benefit of less clutter in your > > > > home directory. > > > > > > I've tried the following based on your above notes, but it seems that > > > emacs doesn't pick up the initialization file located under > > > ~/.config/emacs/ automatically. > > > > > > $ mv .emacs.d/init.el ~/.config/emacs/ > > > > > > Any hints for this problem? > > > > Try removing or renaming ~/.emacs.d, the existence of which might be > > fooling emacs into *not* searching for ~/.config/emacs. For reference, > > see: > > > > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html > > > > Currently, the ~/.emacs.d directory is used by emacs to store many of > the user data as shown below: > > $ ls ~/.emacs.d/ > auto-save-list cnfonts eaf elpa init.el network-security.data rime > url > > So, if I removed/deleted this folder, then where should I put the > emacs' user data? > The operation you really wanted to do in the beginning was probably `mv ~/.emacs.d ~/.config/emacs`. As the manual states the idea is that ~/.config/emacs completely replaces ~/.emacs.d. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 14:38 ` Hongyi Zhao 2020-12-13 14:44 ` Tim Visher @ 2020-12-13 14:52 ` 2QdxY4RzWzUUiLuE 2020-12-13 15:04 ` Tim Visher 2020-12-13 15:12 ` Hongyi Zhao 1 sibling, 2 replies; 23+ messages in thread From: 2QdxY4RzWzUUiLuE @ 2020-12-13 14:52 UTC (permalink / raw) To: help-gnu-emacs On 2020-12-13 at 22:38:08 +0800, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > On Sun, Dec 13, 2020 at 9:59 PM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote: > > > > On 2020-12-13 at 21:50:37 +0800, > > Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> wrote: > > > > > > > > On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > > > > > > As far as the initialization file is concerned, which is more > > > > > preferable,~/.emacs or ~/.emacs.d/init.el? > > > > > > > > If you are choosing between these two, ~/.emacs.d/init.el is > > > > preferable. Because then you can put the whole .emacs.d into version > > > > control separately from your home directory. > > > > > > > > However keep in mind that Emacs 27 adds support for XDG-style > > > > configuration directory, ~/.config/emacs/, which gives you the same > > > > abilities as ~/.emacs.d with an added benefit of less clutter in your > > > > home directory. > > > > > > I've tried the following based on your above notes, but it seems that > > > emacs doesn't pick up the initialization file located under > > > ~/.config/emacs/ automatically. > > > > > > $ mv .emacs.d/init.el ~/.config/emacs/ > > > > > > Any hints for this problem? > > > > Try removing or renaming ~/.emacs.d, the existence of which might be > > fooling emacs into *not* searching for ~/.config/emacs. For reference, > > see: > > > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html > > > > Currently, the ~/.emacs.d directory is used by emacs to store many of > the user data as shown below: > > $ ls ~/.emacs.d/ > auto-save-list cnfonts eaf elpa init.el network-security.data rime url > > So, if I removed/deleted this folder, then where should I put the > emacs' user data? Presumably, ~/.config/emacs is an alternative to ~/.emacs.d, so you would move all of that user data from ~/.emacs.d to ~/.config/emacs. The net result would have been the same if you had renamed ~/.emacs.d to ~/.config/emacs instead of separating the init file from the other user data. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 14:52 ` 2QdxY4RzWzUUiLuE @ 2020-12-13 15:04 ` Tim Visher 2020-12-13 15:12 ` Hongyi Zhao 1 sibling, 0 replies; 23+ messages in thread From: Tim Visher @ 2020-12-13 15:04 UTC (permalink / raw) To: emacs On Sun, Dec 13, 2020 at 9:53 AM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote: > On 2020-12-13 at 22:38:08 +0800, > Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > On Sun, Dec 13, 2020 at 9:59 PM <2QdxY4RzWzUUiLuE@potatochowder.com> > wrote: > > > > > > On 2020-12-13 at 21:50:37 +0800, > > > Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > > > > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> > wrote: > > > > > > > > > > On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> > wrote: > > > > > > > > > > > As far as the initialization file is concerned, which is more > > > > > > preferable,~/.emacs or ~/.emacs.d/init.el? > > > > > > > > > > If you are choosing between these two, ~/.emacs.d/init.el is > > > > > preferable. Because then you can put the whole .emacs.d into > version > > > > > control separately from your home directory. > > > > > > > > > > However keep in mind that Emacs 27 adds support for XDG-style > > > > > configuration directory, ~/.config/emacs/, which gives you the same > > > > > abilities as ~/.emacs.d with an added benefit of less clutter in > your > > > > > home directory. > > > > > > > > I've tried the following based on your above notes, but it seems that > > > > emacs doesn't pick up the initialization file located under > > > > ~/.config/emacs/ automatically. > > > > > > > > $ mv .emacs.d/init.el ~/.config/emacs/ > > > > > > > > Any hints for this problem? > > > > > > Try removing or renaming ~/.emacs.d, the existence of which might be > > > fooling emacs into *not* searching for ~/.config/emacs. For reference, > > > see: > > > > > > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html > > > > > > > Currently, the ~/.emacs.d directory is used by emacs to store many of > > the user data as shown below: > > > > $ ls ~/.emacs.d/ > > auto-save-list cnfonts eaf elpa init.el network-security.data > rime url > > > > So, if I removed/deleted this folder, then where should I put the > > emacs' user data? > > Presumably, ~/.config/emacs is an alternative to ~/.emacs.d, so you > would move all of that user data from ~/.emacs.d to ~/.config/emacs. > The net result would have been the same if you had renamed ~/.emacs.d to > ~/.config/emacs instead of separating the init file from the other user > data. > LOL 2QdxY4RzWzUUiLuE@potatochowder.com and I are really working in lock-step. xD ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 14:52 ` 2QdxY4RzWzUUiLuE 2020-12-13 15:04 ` Tim Visher @ 2020-12-13 15:12 ` Hongyi Zhao 2020-12-13 18:58 ` 2QdxY4RzWzUUiLuE 1 sibling, 1 reply; 23+ messages in thread From: Hongyi Zhao @ 2020-12-13 15:12 UTC (permalink / raw) To: help-gnu-emacs On Sun, Dec 13, 2020 at 10:53 PM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote: > > On 2020-12-13 at 22:38:08 +0800, > Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > On Sun, Dec 13, 2020 at 9:59 PM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote: > > > > > > On 2020-12-13 at 21:50:37 +0800, > > > Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > > > > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> wrote: > > > > > > > > > > On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > > > > > > > > As far as the initialization file is concerned, which is more > > > > > > preferable,~/.emacs or ~/.emacs.d/init.el? > > > > > > > > > > If you are choosing between these two, ~/.emacs.d/init.el is > > > > > preferable. Because then you can put the whole .emacs.d into version > > > > > control separately from your home directory. > > > > > > > > > > However keep in mind that Emacs 27 adds support for XDG-style > > > > > configuration directory, ~/.config/emacs/, which gives you the same > > > > > abilities as ~/.emacs.d with an added benefit of less clutter in your > > > > > home directory. > > > > > > > > I've tried the following based on your above notes, but it seems that > > > > emacs doesn't pick up the initialization file located under > > > > ~/.config/emacs/ automatically. > > > > > > > > $ mv .emacs.d/init.el ~/.config/emacs/ > > > > > > > > Any hints for this problem? > > > > > > Try removing or renaming ~/.emacs.d, the existence of which might be > > > fooling emacs into *not* searching for ~/.config/emacs. For reference, > > > see: > > > > > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html > > > > > > > Currently, the ~/.emacs.d directory is used by emacs to store many of > > the user data as shown below: > > > > $ ls ~/.emacs.d/ > > auto-save-list cnfonts eaf elpa init.el network-security.data rime url > > > > So, if I removed/deleted this folder, then where should I put the > > emacs' user data? > > Presumably, ~/.config/emacs is an alternative to ~/.emacs.d, so you > would move all of that user data from ~/.emacs.d to ~/.config/emacs. > The net result would have been the same if you had renamed ~/.emacs.d to > ~/.config/emacs instead of separating the init file from the other user > data. > The above operation described by you doesn't conform to the XDG base directory specification given on its official website <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>. To be more specific, see the following exceptions from there for more info: Environment variables $XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used. $XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used. So, if we want to let emacs fully comply with this specification, then the data should be put under $XDG_DATA_HOME while the config files should be put under $XDG_CONFIG_HOME. So, the conclusion should be drawn as follows: Emacs data, say, user installed packages ------> $HOME/.local/share/emacs Emacs config files, say, init.el ------> $HOME/.config/emacs Regards -- Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com> Theory and Simulation of Materials Hebei Polytechnic Vocational and Technical University NO. 552 North Gangtie Road, Xingtai, China ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 15:12 ` Hongyi Zhao @ 2020-12-13 18:58 ` 2QdxY4RzWzUUiLuE 2020-12-13 19:12 ` Eli Zaretskii 0 siblings, 1 reply; 23+ messages in thread From: 2QdxY4RzWzUUiLuE @ 2020-12-13 18:58 UTC (permalink / raw) To: help-gnu-emacs On 2020-12-13 at 23:12:39 +0800, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > On Sun, Dec 13, 2020 at 10:53 PM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote: > > Presumably, ~/.config/emacs is an alternative to ~/.emacs.d, so you > > would move all of that user data from ~/.emacs.d to ~/.config/emacs. > > The net result would have been the same if you had renamed > > ~/.emacs.d to ~/.config/emacs instead of separating the init file > > from the other user data. > > The above operation described by you doesn't conform to the XDG base > directory specification given on its official website > <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>. > To be more specific, see the following exceptions from there for more > info: > > Environment variables > > $XDG_DATA_HOME defines the base directory relative to which user > specific data files should be stored. If $XDG_DATA_HOME is either not > set or empty, a default equal to $HOME/.local/share should be used. > > $XDG_CONFIG_HOME defines the base directory relative to which user > specific configuration files should be stored. If $XDG_CONFIG_HOME is > either not set or empty, a default equal to $HOME/.config should be > used. > > So, if we want to let emacs fully comply with this specification, then > the data should be put under $XDG_DATA_HOME while the config files > should be put under $XDG_CONFIG_HOME. So, the conclusion should be > drawn as follows: > > Emacs data, say, user installed packages ------> $HOME/.local/share/emacs > Emacs config files, say, init.el ------> $HOME/.config/emacs That analysis seems sound, but I'm not up on XDG standards or the latest emacs thought processes enough to be sure (and Lisp furhter blurs the line between data and config, not to mention code). Perhaps the emacs maintainer(s) can clarify on this thread, or perhaps you could file a bug report. Eli? Stefan? FWIW, I'm sticking to my very old ~/.emacs.el file and a few explicitly loaded files under ~/.emacs.d. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 18:58 ` 2QdxY4RzWzUUiLuE @ 2020-12-13 19:12 ` Eli Zaretskii 0 siblings, 0 replies; 23+ messages in thread From: Eli Zaretskii @ 2020-12-13 19:12 UTC (permalink / raw) To: help-gnu-emacs > Date: Sun, 13 Dec 2020 12:58:54 -0600 > From: 2QdxY4RzWzUUiLuE@potatochowder.com > > That analysis seems sound, but I'm not up on XDG standards or the latest > emacs thought processes enough to be sure (and Lisp furhter blurs the > line between data and config, not to mention code). Perhaps the emacs > maintainer(s) can clarify on this thread, or perhaps you could file a > bug report. > > Eli? Stefan? It's all in the manual and in NEWS. There's nothing more to it. If something in what the manual says is unclear, please ask more specific questions about the unclear parts. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 13:50 ` Hongyi Zhao 2020-12-13 13:56 ` Tim Visher 2020-12-13 13:58 ` 2QdxY4RzWzUUiLuE @ 2020-12-13 14:06 ` Perry Smith 2020-12-13 14:31 ` Hongyi Zhao 2 siblings, 1 reply; 23+ messages in thread From: Perry Smith @ 2020-12-13 14:06 UTC (permalink / raw) To: Hongyi Zhao; +Cc: help-gnu-emacs, Yuri Khan Are you using emacs 27? > On Dec 13, 2020, at 7:50 AM, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> wrote: >> >> On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: >> >>> As far as the initialization file is concerned, which is more >>> preferable,~/.emacs or ~/.emacs.d/init.el? >> >> If you are choosing between these two, ~/.emacs.d/init.el is >> preferable. Because then you can put the whole .emacs.d into version >> control separately from your home directory. >> >> However keep in mind that Emacs 27 adds support for XDG-style >> configuration directory, ~/.config/emacs/, which gives you the same >> abilities as ~/.emacs.d with an added benefit of less clutter in your >> home directory. > > I've tried the following based on your above notes, but it seems that > emacs doesn't pick up the initialization file located under > ~/.config/emacs/ automatically. > > $ mv .emacs.d/init.el ~/.config/emacs/ > > Any hints for this problem? > > Regards, > -- > Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com> > Theory and Simulation of Materials > Hebei Polytechnic Vocational and Technical University > NO. 552 North Gangtie Road, Xingtai, China > ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 14:06 ` Perry Smith @ 2020-12-13 14:31 ` Hongyi Zhao 0 siblings, 0 replies; 23+ messages in thread From: Hongyi Zhao @ 2020-12-13 14:31 UTC (permalink / raw) To: Perry Smith; +Cc: help-gnu-emacs, Yuri Khan On Sun, Dec 13, 2020 at 10:06 PM Perry Smith <pedz@easesoftware.com> wrote: > > Are you using emacs 27? I compiled the latest emacs git master version: $ emacs --version GNU Emacs 28.0.50 > > > On Dec 13, 2020, at 7:50 AM, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > > > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan <yuri.v.khan@gmail.com> wrote: > >> > >> On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > >> > >>> As far as the initialization file is concerned, which is more > >>> preferable,~/.emacs or ~/.emacs.d/init.el? > >> > >> If you are choosing between these two, ~/.emacs.d/init.el is > >> preferable. Because then you can put the whole .emacs.d into version > >> control separately from your home directory. > >> > >> However keep in mind that Emacs 27 adds support for XDG-style > >> configuration directory, ~/.config/emacs/, which gives you the same > >> abilities as ~/.emacs.d with an added benefit of less clutter in your > >> home directory. > > > > I've tried the following based on your above notes, but it seems that > > emacs doesn't pick up the initialization file located under > > ~/.config/emacs/ automatically. > > > > $ mv .emacs.d/init.el ~/.config/emacs/ > > > > Any hints for this problem? > > > > Regards, > > -- > > Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com> > > Theory and Simulation of Materials > > Hebei Polytechnic Vocational and Technical University > > NO. 552 North Gangtie Road, Xingtai, China > > > -- Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com> Theory and Simulation of Materials Hebei Polytechnic Vocational and Technical University NO. 552 North Gangtie Road, Xingtai, China ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el. 2020-12-13 9:00 ~/.emacs vs ~/.emacs.d/init.el Hongyi Zhao 2020-12-13 9:06 ` Christopher Dimech 2020-12-13 10:09 ` Yuri Khan @ 2020-12-13 19:12 ` Emanuel Berg via Users list for the GNU Emacs text editor 2 siblings, 0 replies; 23+ messages in thread From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-12-13 19:12 UTC (permalink / raw) To: help-gnu-emacs Hongyi Zhao wrote: > As far as the initialization file is concerned, which is more > preferable,~/.emacs or ~/.emacs.d/init.el? Hm... preferable in what sense? .emacs will be evaluated when Emacs initializes upon normal invocation but as far as the configuration goes, it doesn't matter where you put it or in what way you evaluate it. If you want to have it somewhere else, for practical or modular reasons (e.g., one file for each thing you configure/extend), in .emacs you can just `push' the path(s) where it/they are to `load-path' and then use `load-file' to get it in effect. -- underground experts united http://user.it.uu.se/~embe8573 https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 23+ messages in thread
* ~/.emacs vs ~/.emacs.d/init.el @ 2007-06-13 10:00 Juanma Barranquero 2007-06-13 17:28 ` Eli Zaretskii 2007-06-21 18:54 ` Davis Herring 0 siblings, 2 replies; 23+ messages in thread From: Juanma Barranquero @ 2007-06-13 10:00 UTC (permalink / raw) To: Emacs Devel With the recent introduction of `user-emacs-directory', I've been wondering... Could someone please clarify the relation between these things: --user (option for Emacs) init-file-user ~/.emacs. (also _emacs, .emacs.el, _emacs.el) ~USER/.emacs (is that possible on Windows?) ~/.emacs.d/init.el ~USER/.emacs.d/init.el (is that possible at all?) I've read the info nodes "Init File", "Find Init" and "Initial Options"; I've also looked at the code. I'm still not sure whether emacs --user=another should make ~another/.emacs.d/init.el possible, though the code suggests that the answer is not (~/.emacs.d/ was hardcoded, and `user-emacs-directory' does not change that), and I'm not sure why (conceptually speaking). Juanma ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el 2007-06-13 10:00 Juanma Barranquero @ 2007-06-13 17:28 ` Eli Zaretskii 2007-06-13 17:34 ` Juanma Barranquero 2007-06-21 18:54 ` Davis Herring 1 sibling, 1 reply; 23+ messages in thread From: Eli Zaretskii @ 2007-06-13 17:28 UTC (permalink / raw) To: Juanma Barranquero; +Cc: emacs-devel > Date: Wed, 13 Jun 2007 12:00:32 +0200 > From: "Juanma Barranquero" <lekktu@gmail.com> > > ~USER/.emacs (is that possible on Windows?) No, we don't support ~USER on Windows yet (although it can be done on the Windows versions since W2K). Volunteers welcome. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el 2007-06-13 17:28 ` Eli Zaretskii @ 2007-06-13 17:34 ` Juanma Barranquero 2007-06-13 17:53 ` Eli Zaretskii 0 siblings, 1 reply; 23+ messages in thread From: Juanma Barranquero @ 2007-06-13 17:34 UTC (permalink / raw) To: Eli Zaretskii; +Cc: emacs-devel On 6/13/07, Eli Zaretskii <eliz@gnu.org> wrote: > No, we don't support ~USER on Windows yet (although it can be done on > the Windows versions since W2K). Volunteers welcome. I wouldn't dismiss the idea of implementing it myself, once the task is clear enough. What about my other questions? Should --user=myuser influence whether init.el is found (I mean, ~myuser/.emacs.d/init.el), or is ~/.emacs.d/ always valid only for the current user? Juanma ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el 2007-06-13 17:34 ` Juanma Barranquero @ 2007-06-13 17:53 ` Eli Zaretskii 2007-06-13 17:57 ` Juanma Barranquero 0 siblings, 1 reply; 23+ messages in thread From: Eli Zaretskii @ 2007-06-13 17:53 UTC (permalink / raw) To: Juanma Barranquero; +Cc: emacs-devel > Date: Wed, 13 Jun 2007 19:34:00 +0200 > From: "Juanma Barranquero" <lekktu@gmail.com> > Cc: emacs-devel@gnu.org > > On 6/13/07, Eli Zaretskii <eliz@gnu.org> wrote: > > > No, we don't support ~USER on Windows yet (although it can be done on > > the Windows versions since W2K). Volunteers welcome. > > I wouldn't dismiss the idea of implementing it myself, once the task > is clear enough. The task is to map ~USER to C:/Documents and Settings/USER/Application Data For this, we need to extend w32.c:getpwnam to support not just the current user, but also the other users on the local machine (ask me about the relevant Windows APIs if you need help finding them), and then it should Just Work (the actuall expansion happens in expand-file-name and other similar primitives defined on fileio.c). > What about my other questions? Should --user=myuser influence whether > init.el is found (I mean, ~myuser/.emacs.d/init.el), or is ~/.emacs.d/ > always valid only for the current user? I don't have anything intelligent to say on that, I'm confused myself. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el 2007-06-13 17:53 ` Eli Zaretskii @ 2007-06-13 17:57 ` Juanma Barranquero 0 siblings, 0 replies; 23+ messages in thread From: Juanma Barranquero @ 2007-06-13 17:57 UTC (permalink / raw) To: Eli Zaretskii; +Cc: emacs-devel On 6/13/07, Eli Zaretskii <eliz@gnu.org> wrote: > The task is to map ~USER to > > C:/Documents and Settings/USER/Application Data > > For this, we need to extend w32.c:getpwnam to support not just the > current user, but also the other users on the local machine (ask me > about the relevant Windows APIs if you need help finding them), and > then it should Just Work (the actuall expansion happens in > expand-file-name and other similar primitives defined on fileio.c). OK, I'll put this issue in my ToDo list. > I don't have anything intelligent to say on that, I'm confused myself. Glad to know I'm in good company, then ;-) Juanma ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el 2007-06-13 10:00 Juanma Barranquero 2007-06-13 17:28 ` Eli Zaretskii @ 2007-06-21 18:54 ` Davis Herring 2007-06-21 19:18 ` Juanma Barranquero 1 sibling, 1 reply; 23+ messages in thread From: Davis Herring @ 2007-06-21 18:54 UTC (permalink / raw) To: Juanma Barranquero; +Cc: Emacs Devel > I've read the info nodes "Init File", "Find Init" and "Initial > Options"; I've also looked at the code. I'm still not sure whether > > emacs --user=another > > should make ~another/.emacs.d/init.el possible, though the code > suggests that the answer is not (~/.emacs.d/ was hardcoded, and > `user-emacs-directory' does not change that), and I'm not sure why > (conceptually speaking). It certainly should! --user picks a _directory_ (the home directory of a user), and .emacs, .emacs.d/init.el, etc. are all conceptually relative filenames in that directory. I hate to duplicate the `user-emacs-directory' variable (or whatever it ends up being called), but those filenames should really get `expand-file-name'd against a home directory chosen by that option (or by $HOME otherwise). Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: ~/.emacs vs ~/.emacs.d/init.el 2007-06-21 18:54 ` Davis Herring @ 2007-06-21 19:18 ` Juanma Barranquero 0 siblings, 0 replies; 23+ messages in thread From: Juanma Barranquero @ 2007-06-21 19:18 UTC (permalink / raw) To: herring; +Cc: Emacs Devel On 6/21/07, Davis Herring <herring@lanl.gov> wrote: > It certainly should! --user picks a _directory_ (the home directory of a > user), and .emacs, .emacs.d/init.el, etc. are all conceptually relative > filenames in that directory. Yes, that's my interpretation, too. But ~/.emacs.d/ appeared at least seven years ago (there's a reference in the ChangeLog from 2000-04-24). It's hard to believe nobody has worried about -u in all that time. <conspiranoia>Something Else Is At Work...</conspiranoia> > I hate to duplicate the > `user-emacs-directory' variable (or whatever it ends up being called), but > those filenames should really get `expand-file-name'd against a home > directory chosen by that option (or by $HOME otherwise). The Function Without a Name can take care of that easily, I think. Juanma ^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2020-12-13 19:12 UTC | newest] Thread overview: 23+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-12-13 9:00 ~/.emacs vs ~/.emacs.d/init.el Hongyi Zhao 2020-12-13 9:06 ` Christopher Dimech 2020-12-13 10:09 ` Yuri Khan 2020-12-13 13:50 ` Hongyi Zhao 2020-12-13 13:56 ` Tim Visher 2020-12-13 13:58 ` 2QdxY4RzWzUUiLuE 2020-12-13 14:38 ` Hongyi Zhao 2020-12-13 14:44 ` Tim Visher 2020-12-13 14:52 ` 2QdxY4RzWzUUiLuE 2020-12-13 15:04 ` Tim Visher 2020-12-13 15:12 ` Hongyi Zhao 2020-12-13 18:58 ` 2QdxY4RzWzUUiLuE 2020-12-13 19:12 ` Eli Zaretskii 2020-12-13 14:06 ` Perry Smith 2020-12-13 14:31 ` Hongyi Zhao 2020-12-13 19:12 ` Emanuel Berg via Users list for the GNU Emacs text editor -- strict thread matches above, loose matches on Subject: below -- 2007-06-13 10:00 Juanma Barranquero 2007-06-13 17:28 ` Eli Zaretskii 2007-06-13 17:34 ` Juanma Barranquero 2007-06-13 17:53 ` Eli Zaretskii 2007-06-13 17:57 ` Juanma Barranquero 2007-06-21 18:54 ` Davis Herring 2007-06-21 19:18 ` Juanma Barranquero
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.