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: Chong Yidong
Subject: Re: Use .emacs.d in savehist.el
Date: Sun, 30 Oct 2005 08:59:43 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Miles Bader <address@hidden> writes:

>> I didn't implement Miles' suggestion; it just doesn't seem necessary
>> (unless I'm missing something.)
>
> The point is that are various simple rules and guidelines that apply
> to _every_ customization file, if we allow them to go in either ~ or
> in ~/.emacs.d, and it's silly to duplicate the code for each
> customization file.
>
> Centralizing the policy with a function also allows later changes or
> enhancement to be done more easily and cleanly.

OK, now I see.

It may or may not make sense to use such a function for the init file
(though I agree that it's useful for elsewhere in Emacs.)  The
`command-line' has some strange magic going on in it: instead of
checking whether the file exists and is readable, it sets
`user-init-file' to t, and tries to load the filename
(`user-init-file-1'):

      ;; This tells `load' to store the file name found
      ;; into user-init-file.
      (setq user-init-file t)
      (load user-init-file-1 t t)

If the `load' function succeeds, it automagically binds
`user-init-file' to the loaded filename.  I don't know why this was
written this way, but maybe there is a reason?

Also, if you want to use this function for the init file, you would
have to account for the "_emacs" dotfile name used on MS-DOS and
MS-Windows.  In particular, MS-Windows uses "~/.emacs" by default, but
if that is not available it accepts "~/_emacs" as the dotfile.


Another note: it seems to me that most libraries that use ".emacs.d"
look for it in "~".  Would it make sense to extend the
`init-file-user' variable so that the directory goes into

      (concat "~" init-file-user "/.emacs.d")

instead?  Or should `init-file-user' continue to apply to init files
only?




reply via email to

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