From: Larry Evans <cppljevans@suddenlink.net>
To: help-gnu-emacs@gnu.org
Subject: Re: .emacs (load {user-init-file, custom-file} causes duplicate load of both
Date: Thu, 11 Nov 2010 06:09:16 -0600 [thread overview]
Message-ID: <ibgmdd$qbe$1@dough.gmane.org> (raw)
In-Reply-To: <ibgjm0$crp$1@dough.gmane.org>
On 11/11/10 05:22, Larry Evans wrote:
> On 11/11/10 01:45, Eli Zaretskii wrote:
>>> From: Larry Evans <cppljevans@suddenlink.net>
>>> 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.
>>
>>
>
> Hi Eli,
>
> Unfortunately, after renaming the variables to:
>
> my-user-init-file
> my-custom-file
>
> the *Messages* buffer still had the duplicate loads.
>
> My real reason for investigating this is I'm trying to avoid
> the error message:
>
> "Current desktop was not loaded from a file. Overwrite this desktop file? "
>
> from function desktop-save in desktop.el.gz. A trace in that function
> showed:
>
> desktop-file-modtime
>
> was nil. Further search in that file showed the only place that was
> set was in function desktop-read. So, in .emacs I put:
>
> (desktop-read)
>
> However, that didn't work.
>
> Any help resolving this would be appreciated.
[snip]
OOPS. A more careful reading of *Messages* shows that the there
was a slight difference in the entries:
Loading /home/evansl/.xemacs/custom.el (source)...
Loading desktop...done
Loading /home/evansl/.xemacs/custom.el (source)...done
The 1st Loading was for the start of loading. The 2nd,
as the trailing ...done indicates, is for the end of the
loading.
Sorry for noise. However, why am I getting the error message
from function desktop-save?
-Larry
next prev parent reply other threads:[~2010-11-11 12:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-11 1:14 .emacs (load {user-init-file, custom-file} causes duplicate load of both Larry Evans
2010-11-11 2:28 ` PJ Weisberg
2010-11-11 3:28 ` Larry Evans
2010-11-11 7:45 ` Eli Zaretskii
2010-11-11 11:22 ` Larry Evans
2010-11-11 12:09 ` Larry Evans [this message]
2010-11-11 14:32 ` Larry Evans
2010-11-11 18:26 ` Eli Zaretskii
2010-11-11 18:44 ` Larry Evans
2010-11-13 12:43 ` Howto avoid "Overwrite desktop file" question. (was " Larry Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='ibgmdd$qbe$1@dough.gmane.org' \
--to=cppljevans@suddenlink.net \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.