emacs-devel
[Top][All Lists]
Advanced

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

User directories.


From: Francisco Miguel Colaço
Subject: User directories.
Date: Sat, 21 Jul 2012 01:00:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

-----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 <address@hidden>
-----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-----



reply via email to

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