XDG Compliant init directory.
authorSteve Youngs <steve@sxemacs.org>
Sat, 2 May 2015 15:56:21 +0000 (01:56 +1000)
committerSteve Youngs <steve@sxemacs.org>
Sat, 2 May 2015 15:56:21 +0000 (01:56 +1000)
commit1637e28a4d2034d934a1c7e7ea5a70b3fd32a577
tree9808f7857a43059a071cc3514df738988249e6f1
parent04168e3fa98cd90961d773c5ffda67a6797f8dd7
XDG Compliant init directory.

This changeset moves the init directory from ~/.sxemacs to
$XDG_CONFIG_HOME/sxemacs, falling back to ~/.config/sxemacs when
$XDG_CONFIG_HOME isn't set.

SXEmacs will continue to use ~/.sxemacs if that directory exists, unless
the XDG-based directory also exists.  In that case, the XDG-based directory
will take precedence, unless the user has set $SXE_USE_LEGACY in their
environment.

If no init directories exist, use the XDG-based directory, unless
$SXE_USE_LEGACY has been set.

If multiple init directories exist a warning is displayed to the user
showing the directories found, and which is the one in use.  This warning
can be suppressed by adding the symbol `multi-initd' to
`display-warning-suppressed-classes'

* lisp/startup.el (find-user-init-directory): New.
(user-init-directory): Set to empty string.
(user-init-directory-base): Removed.
(command-line-do-help): Warn that using -user may not be the
wisest of choices.
(command-line-early): When using -user set user-init-directory to
~user/.config/sxemacs, or ~user/.sxemacs if that doesn't exist.
(site-start-file): Doc fix.

* lisp/site-start.el: New.  Deals with the consequences of
computing a user-init-directory at run-time.

* lisp/Makefile.am (corelispels): Add site-start.el.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
lisp/Makefile.am
lisp/site-start.el [new file with mode: 0644]
lisp/startup.el