[Top][All Lists]

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

Re: Don't concat directories to file names

From: Stefan Monnier
Subject: Re: Don't concat directories to file names
Date: Fri, 15 Jun 2007 10:33:47 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

> Then the recently introduced `user-emacs-directory' should be renamed
> to `user-init-directory',

Indeed.  Please: could someone do that?

> The variable currently must end with a directory separator, but that could
> be fixed.

It should be fixed.  We should be careful to make it work with or without
a terminating / since it can be set by the user.  If we systematically use
it with expand-file-name, this will work automatically.

> (defun user-emacs-file (name &optional new-name)

If we rename the variable to user-init-directory, then the function should
probably be called user-init-file.

>  "Convert NAME to an absolute per-user Emacs-specific path.
> If \"~/NAME\" exists, or `user-emacs-directory' is nil, return \"~/NAME\".
> Else, return \"`user-emacs-directory'/NEW-NAME\", or /NAME if NEW-NAME is 
> nil."
>  (convert-standard-filename
>   (let ((at-home (expand-file-name name (concat "~" init-file-user))))
>     (if (or (file-readable-p at-home)
>             (null user-emacs-directory))
>         at-home
>       (or (file-accessible-directory-p (directory-file-name
> user-emacs-directory))
>           (progn (make-directory user-emacs-directory) t)  ;; don't
> catch errors
>           (expand-file-name (or new-name name) user-emacs-directory))))))

In most places that introduced the ~/.emacs.d thingy, they typically first
check ~/.emacs.d/TOTO then ~/.TOTO and if neither is present return


reply via email to

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