emacs-devel
[Top][All Lists]
Advanced

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

Re: Use .emacs.d in savehist.el


From: Miles Bader
Subject: Re: Use .emacs.d in savehist.el
Date: Sun, 30 Oct 2005 09:03:30 +0900

2005/10/30, Kim F. Storm <address@hidden>:
> I like this too, but functionality should be:
> If DOTFILE non-nil and ~/DOTFILE exists, use ~/DOTFILE, else [as above].
> Otherwise, some old DOTFILE will suddenly "disappear" if the user later 
> creates .emacs.d

Good point; this rule should apply to implicitly specified dotfile
name too of course.

Here's an implementation that seems to get the details right (it
probably ought to check that "~/.emacs.d" is actually a directory,
rather than seeing if merely exists or not):

(defvar user-customization-file-dir "~/.emacs.d")

(defun user-customization-file-name (base &optional dotfile)
  (unless dotfile
    (setq dotfile (concat "." base)))
  (setq dotfile (expand-file-name dotfile "~"))
  (if (or (file-exists-p dotfile)
          (not (file-exists-p user-customization-file-dir)))
      dotfile
    (expand-file-name base user-customization-file-dir)))

-miles
--
Do not taunt Happy Fun Ball.




reply via email to

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