[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Francisco Miguel Colaço
Fri, 20 Jul 2012 21:34:52 +0100
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1
-----BEGIN PGP SIGNED MESSAGE-----
I propose the inclusion of the package user-directories.el (annexed)
in emacs, eventually after a good scrubbing of the source.
The package separates the user configuration, data and cache
directories according to the XDG Base Directory Standard. By having the
cooperation of the emacs package writers, one can clearly separate what
should be backed up (data and configuration) from what is not.
The package defines user-emacs-config-directory (defaulting to
~/.config/emacs), user-emacs-data-directory (defaulting to
~/.local/share/emacs) and user-emacs-cache-directory (defaulting to
~/.cache/emacs). One can thus write something like:
- --- BEGIN LISP EXAMPLE ---
;; Set and load the custom file, if it does exist.
(setq custom-file (locate-user-config-file "custom.el"))
(load custom-file t)
;; Load the auxiliary modules.
(dolist (module (list "functions"
(format "emacs-version-%d" emacs-major-version)
(format "system-type-%s" (subst-char-in-string ?/ ?-
(format "system-name-%s" system-name)
(format "window-system-%s" (symbol-name window-system))
"edit" "prog" "tex" "xml" "frame" "keys"))
(load (locate-user-config-file (format "conf-%s" module)) t))
;; If there are no other arguments passed and no initial buffer choice
;; made, open is user-emacs-documents-directory.
(unless (or initial-buffer-choice (> (length command-line-args) 1))
(setq initial-buffer-choice user-emacs-documents-directory))
- --- END LISP EXAMPLE ---
Of course, this set up would greatly benefit from the adherence of the
emacs lisp package writers. This would result in better backup policies
and less $HOME pollution for the user.
In this spirit I would also counsel that the path
~/.config/emacs/init.el[c] should be tried as a source for the user
emacs init file.
I have been using this package for roughly a year now and would not
live without it. I have to conform to having made ~/.emacs.d a symbolic
link to ~/.local/share/emacs and ~/.emacs.d/init.el to
~/.config/emacs/init.el as a fallback default against hard coded path
names, which abound within emacs lisp packages.
Please do comment and make suggestions.
Francisco Miguel Colaço <address@hidden>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
- User directories.,
Francisco Miguel Colaço <=