help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: .emacs (load {user-init-file, custom-file} causes duplicate load of


From: Eli Zaretskii
Subject: Re: .emacs (load {user-init-file, custom-file} causes duplicate load of both
Date: Thu, 11 Nov 2010 02:45:14 -0500

> From: Larry Evans <address@hidden>
> Date: Wed, 10 Nov 2010 19:14:25 -0600
> 
> My ~/.emacs file contains (amoung other things):
> 
> ---{~/.emacs---
> (setq user-init-file
>       (expand-file-name "init.el"
>                       (expand-file-name ".emacs.d" "~")))
> (setq custom-file
>       (expand-file-name "custom.el"
>                       (expand-file-name ".xemacs" "~")))
> (load-file user-init-file)
> (load-file custom-file)
> ---}~/.emacs---
> 
> When started with this, the *messages* buffer contains:
> 
> ---{*messages---
> Loading /home/evansl/.emacs.d/init.el (source)...
> Loading /home/evansl/.recentf...done
> Cleaning up the recentf list...done (0 removed)
> Loading /home/evansl/.emacs.d/init.el (source)...done
> Loading /home/evansl/.xemacs/custom.el (source)...
> Loading desktop...done
> Loading /home/evansl/.xemacs/custom.el (source)...done
> ---}*messages---
> 
> Why are both user-init-file and custom-file both loaded twice?

Because you are overriding the values of variables that Emacs uses at
startup.  The startup procedure involves some non-trivial logic for
loading user-init-file and custom-file, and you are interfering with
that logic by setting their values in your ~/.emacs, which is read
half-way through the startup process.

Simply load the files by name, or use other variables.  Then Emacs
should load these files only once, as you want.



reply via email to

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