From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Larry Evans Newsgroups: gmane.emacs.help Subject: Re: .emacs (load {user-init-file, custom-file} causes duplicate load of both Date: Thu, 11 Nov 2010 08:32:36 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1289486012 5282 80.91.229.12 (11 Nov 2010 14:33:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 11 Nov 2010 14:33:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 11 15:33:28 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PGYDP-0005SN-Hc for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Nov 2010 15:33:28 +0100 Original-Received: from localhost ([127.0.0.1]:56986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGYDL-0000qb-Vl for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Nov 2010 09:33:23 -0500 Original-Received: from [140.186.70.92] (port=56987 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGYCu-0000qW-1m for help-gnu-emacs@gnu.org; Thu, 11 Nov 2010 09:32:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGYCs-0004fx-CU for help-gnu-emacs@gnu.org; Thu, 11 Nov 2010 09:32:55 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:46390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGYCs-0004fg-1d for help-gnu-emacs@gnu.org; Thu, 11 Nov 2010 09:32:54 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PGYCn-0005D5-GO for help-gnu-emacs@gnu.org; Thu, 11 Nov 2010 15:32:49 +0100 Original-Received: from r74-192-37-54.vctrcmta01.vctatx.tl.dh.suddenlink.net ([74.192.37.54]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Nov 2010 15:32:49 +0100 Original-Received: from cppljevans by r74-192-37-54.vctrcmta01.vctatx.tl.dh.suddenlink.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Nov 2010 15:32:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 100 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: r74-192-37-54.vctrcmta01.vctatx.tl.dh.suddenlink.net User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Lightning/1.0b1 Thunderbird/3.0.6 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75346 Archived-At: On 11/11/10 06:09, Larry Evans wrote: > On 11/11/10 05:22, Larry Evans wrote: >> On 11/11/10 01:45, Eli Zaretskii wrote: >>>> From: Larry Evans >>>> 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? > Placed a (debug) in .emacs just before the loads for my-*-file. Then did some tracing, but nothing was helpful. However, after that, the error message from desktop-read about desktop file already in use showed at bottom of frame. Strange thing is that before that message showed in some sort of widget. So I answered to use anyway. Then exited emacs, and now no error message occurs when emacs restarted. I've no idea why. Anyone have a clue? -regards, Larry