all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* User directories.
@ 2012-07-21  0:00 Francisco Miguel Colaço
  0 siblings, 0 replies; only message in thread
From: Francisco Miguel Colaço @ 2012-07-21  0:00 UTC (permalink / raw)
  To: GNU Emacs Devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


  Dear friends,

  I propose the inclusion of the package user-directories.el (that I
left in GNU Emacs Sources list) in emacs, eventually after a good
scrubbing of the package.
  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 ?/ ?-
(symbol-name system-type)))
              (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.

    Best regards,

      Francisco Colaço

- -- 
Francisco Miguel Colaço <francisco.colaco@gmail.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQCfEvAAoJEKszN4Xbg5EfYzoH/1E2BpnU1L3O8os2vfeThYyf
4pk2bkvoRN7th8NoAR+OfMH234XIC9tfO78voKqqaBBw1KLyWGWNAhxXsdSfEtkG
ncjj/xO5tR/v32Fwk6uqHdie+55iXO7vGWGzqpKY5CVwx/b7qX9y9b1ED0h208qN
gWWl7BzWi/j9kDoMopSkzn4a/E+JEFW8N/RiIJ8RXx8+CKLP/iep8V9HX7jkHBbA
Sye5lIqEJ0pY6deXAtwOuJNk0H6das5bdv/jycI/PvlozDHftZ68Ba6s6RWGMUhX
QeVDFc5NoKuOJTPDfYECTH4kxptNzVVGj0GDpLQM/S1aBGKrQhwTkKxGbpkJ0v4=
=DPL+
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-21  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-21  0:00 User directories Francisco Miguel Colaço

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.