From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Trent Buck Newsgroups: gmane.emacs.bugs Subject: Re: eval-after-load weirdness Date: Mon, 21 May 2007 09:27:00 +1000 Message-ID: <87odkfnkjf.fsf@baal.lan> References: <20070519035956.GA9040@baal.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1179710460 14972 80.91.229.12 (21 May 2007 01:21:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 May 2007 01:21:00 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 21 03:20:58 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hpwa1-0002g2-UI for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 May 2007 03:20:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hpwa1-0004yR-EK for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 May 2007 21:20:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HpwZy-0004yB-Ss for bug-gnu-emacs@gnu.org; Sun, 20 May 2007 21:20:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HpwZw-0004xT-GS for bug-gnu-emacs@gnu.org; Sun, 20 May 2007 21:20:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HpwZw-0004xF-AH for bug-gnu-emacs@gnu.org; Sun, 20 May 2007 21:20:52 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HpwZv-0005B0-VS for bug-gnu-emacs@gnu.org; Sun, 20 May 2007 21:20:52 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1HpwUJ-0005Zm-00 for bug-gnu-emacs@gnu.org; Mon, 21 May 2007 03:15:03 +0200 Original-Received: from cpe-155-143-223-85.vic.bigpond.net.au ([155.143.223.85]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 May 2007 03:15:02 +0200 Original-Received: from trentbuck by cpe-155-143-223-85.vic.bigpond.net.au with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 May 2007 03:15:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cpe-155-143-223-85.vic.bigpond.net.au User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux) Cancel-Lock: sha1:nDJz1m5r9V61W2gLN2tIJ+SoFEg= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15717 Archived-At: "Trent Buck" writes: > I'm noticing the most bizarre symptom with my .emacs[0]: > eval-after-load works right when passed a symbol, but not when > passed a string. Some examples: > > $ emacs-unicode-2 -f toggle-debug-on-error `mktemp` > Debugger entered--Lisp error: (void-variable vc-directory-exclusion-list) > add-to-list(vc-directory-exclusion-list ".bzr" t) > eval((add-to-list (quote vc-directory-exclusion-list) ".bzr" t)) > eval-after-load("vc" (add-to-list (quote vc-directory-exclusion-list) ".bzr" t)) I worked out what the trouble is: because my modular .emacs setup has each configuration module named after the library it configures (e.g. ~/.emacs-prefs/vc.el for the vc library), eval-after-load thinks "vc" has already been loaded. Obviously (featurep 'vc) is still nil so giving symbols to e-a-l works. Some solutions suggested on #emacs: - stuff everything back into a single .emacs; - prefix filenames with digits (e.g. 20vc.el), like system V init scripts; and - instead of LOADing each config module, FIND-FILE it and then EVAL-BUFFER it. I produced a minimal example of the problem at http://paste.lisp.org/display/41451 -- Trent Buck