bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15539: Fwd: bug#15539: [PATCH] Setting user-emacs-directory


From: François Févotte
Subject: bug#15539: Fwd: bug#15539: [PATCH] Setting user-emacs-directory
Date: Thu, 24 Mar 2016 20:21:31 +0100

Dear Emacs developers,

sorry for the late reaction: I thought I was subscribed to this bug, but I
somehow wasn't and only just saw last month's discussions.

I fully understand that putting yet another knob in Emacs implies an added
complexity which is not necessarily desirable. However, I would like to
emphasize that the proposed patch does not "change a well-established
constant". People not wanting to know about this new behavior will never see
any change. And I would expect that any user explicitly setting an
`EMACS_USER_DIRECTORY' environment variable know what they are doing.

Also, below is a list of methods (that I know of) which can help users start
Emacs with an initialization file in a custom location. None of them are
flawless, which justifies IMHO the introduction of a feature like the one
proposed here. But even if you still find that there is no real need for such a
feature (which would be perfectly fine by me), at least this list might help
future users stumbling on this bug report...


* Method 1 (as mentioned by Eli Zaretskii above): set the HOME environment
  variable.

  This works well, and can even be set on a per-process basis, which is a
  desirable feature IMO.  This method however has potentially unwelcome side
  effects, mainly related to the fact that $HOME is used in a lot of different
  contexts, unrelated to the Emacs startup process. In particular:

  - All processes launched from within Emacs will inherit this setting. This can
    easily be avoided be re-setting HOME to its normal value in
    `process-environment' within Emacs.

  - All paths beginning with `~/' will be expanded to the "fake" HOME directory,
    which can be confusing. One can reset the HOME environment variable from
    within Emacs using `setenv' to avoid that. But then problems can arise since
    `user-emacs-directory' itself is by default "~/.emacs.d".


* Method 2: set a symbolic link from ~/.emacs.d to somewhere else.

  This method is mainly useful to help quickly switch between different profiles
  by having the symlink point to one of several possible directories.
It's very easy
  to set up (which is why many users seem to do it), but has the main drawback
  that multiple Emacs instances running concurrently must all share the same
  user directory.


* Method 3: run `emacs -q -l SOMEWHERE/init.el'

  The initialization file located SOMEWHERE/init.el can then set things up
  correctly like this:

    (setq user-init-file (or load-file-name (buffer-file-name)))
    (setq user-emacs-directory (file-name-directory user-init-file))

  Like the first method above, this one works on a per-process basis and one can
  run different instances of Emacs using different user directories.

  The main drawback of this approach is that it entirely bypasses the normal
  startup process. Things like `emacs-init-time', `after-init-hook',
  `initial-major-mode' (list is not exhaustive) don't work as expected.


Again, I you feel like the added complexity is not worth the extra flexibility
for users, that's fine by me. Just ignore my message and leave the bug closed.

Cheers,
    François





reply via email to

[Prev in Thread] Current Thread [Next in Thread]