* eval-after-load weirdness
@ 2007-05-19 3:59 Trent Buck
2007-05-20 23:27 ` Trent Buck
[not found] ` <mailman.896.1179710457.32220.bug-gnu-emacs@gnu.org>
0 siblings, 2 replies; 4+ messages in thread
From: Trent Buck @ 2007-05-19 3:59 UTC (permalink / raw)
To: bug-gnu-emacs; +Cc: trentbuck
[-- Attachment #1.1: Type: text/plain, Size: 2569 bytes --]
[Please CC me; I'm not subscribed to the list.]
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))
$ emacs-snapshot -f toggle-debug-on-error -f gnus
Debugger entered--Lisp error: (void-variable mail-mode-map)
(define-key mail-mode-map "\x03\x01" (quote mail-abbrev-insert-alias))
(progn (define-key mail-mode-map "\x03\x01" (quote mail-abbrev-insert-alias))
(define-key mail-mode-map "^[ " (quote mail-abbrev-complete-alias)))
eval((progn (define-key mail-mode-map "\x03\x01" (quote mail-abbrev-insert-alias))
(define-key mail-mode-map "^[ " (quote mail-abbrev-complete-alias))))
eval-after-load("sendmail" (progn (define-key mail-mode-map "\x03\x01" (quote mail-abbrev-insert-alias))
(define-key mail-mode-map "^[ " (quote mail-abbrev-complete-alias))))
Adding -q (i.e. disabling my .emacs) stops these errors. I'm at my
wits end... can anyone suggest what could be causing this?
[0] http://twb.ath.cx/~twb/scratch/profile/.emacs
http://twb.ath.cx/~twb/scratch/profile/.emacs-prefs/
http://twb.ath.cx/~twb/scratch/profile/.emacs-apps/
In GNU Emacs 23.0.0.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2007-05-13 on baal, modified by Debian
(Debian emacs-unicode-2 package, version 1:20070513-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10300000
configured using `configure '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-unicode-2:/etc/emacs:/usr/local/share/emacs/23.0.0/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.0/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.0.0/leim' '--enable-font-backend' '--with-xft' '--with-x=yes' '--with-x-toolkit=athena' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2''
--
Trent Buck
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: eval-after-load weirdness
2007-05-19 3:59 eval-after-load weirdness Trent Buck
@ 2007-05-20 23:27 ` Trent Buck
[not found] ` <mailman.896.1179710457.32220.bug-gnu-emacs@gnu.org>
1 sibling, 0 replies; 4+ messages in thread
From: Trent Buck @ 2007-05-20 23:27 UTC (permalink / raw)
To: bug-gnu-emacs
"Trent Buck" <trentbuck@gmail.com> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <mailman.896.1179710457.32220.bug-gnu-emacs@gnu.org>]
* Re: eval-after-load weirdness
[not found] ` <mailman.896.1179710457.32220.bug-gnu-emacs@gnu.org>
@ 2007-05-22 22:59 ` Miles Bader
2007-05-23 1:46 ` Trent Buck
0 siblings, 1 reply; 4+ messages in thread
From: Miles Bader @ 2007-05-22 22:59 UTC (permalink / raw)
To: Trent Buck; +Cc: bug-gnu-emacs
Trent Buck <trentbuck@gmail.com> writes:
> 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.
...
> 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.
You could also just remove the init files from `load-history' after the
fact.
E.g. (at the end of your .emacs):
(let ((remove-regexp
(concat "\\`" (regexp-quote (file-truename "~/.emacs-prefs/"))))
(new-load-hist nil))
(dolist (entry load-history)
(unless (string-match remove-regexp (car entry))
(push entry new-load-hist)))
(setq load-history (nreverse new-load-hist)))
-miles
--
(\(\
(^.^)
(")")
*This is the cute bunny virus, please copy this into your sig so it can spread.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: eval-after-load weirdness
2007-05-22 22:59 ` Miles Bader
@ 2007-05-23 1:46 ` Trent Buck
0 siblings, 0 replies; 4+ messages in thread
From: Trent Buck @ 2007-05-23 1:46 UTC (permalink / raw)
To: Miles Bader; +Cc: bug-gnu-emacs
[-- Attachment #1.1: Type: text/plain, Size: 2519 bytes --]
On Wed, May 23, 2007 at 07:59:22AM +0900, Miles Bader wrote:
> Trent Buck <trentbuck@gmail.com> writes:
> > 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.
> ...
> > 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.
>
> You could also just remove the init files from `load-history' after the
> fact.
>
> E.g. (at the end of your .emacs):
>
> (let ((remove-regexp
> (concat "\\`" (regexp-quote (file-truename "~/.emacs-prefs/"))))
> (new-load-hist nil))
> (dolist (entry load-history)
> (unless (string-match remove-regexp (car entry))
> (push entry new-load-hist)))
> (setq load-history (nreverse new-load-hist)))
I think that would solve EVAL-AFTER-LOADs in Emacs itself, but not
those scattered throughout .emacs-prefs/ itself. Here is the change I
eventually made per method (3), which solves the problem.
Mon May 21 19:30:33 EST 2007 Trent Buck <trentbuck@gmail.com>
* .emacs: don't use LOAD in .emacs-prefs.
Doing so breaks EVAL-AFTER-LOAD when passed a string as argument.
See http://paste.lisp.org/display/41451 for details.
diff -rN -u old-profile/.emacs new-profile/.emacs
--- old-profile/.emacs 2007-05-23 11:39:23.219566437 +1000
+++ new-profile/.emacs 2007-05-23 11:39:23.267571168 +1000
@@ -17,9 +17,11 @@
(let ((default-directory "~/.emacs-prefs/"))
(when (file-accessible-directory-p ".")
(load (expand-file-name "Emacs.el") t)
(load (expand-file-name
(format "window-system-%s.el" window-system)) t)
- (mapc (lambda (x)
- (when (locate-library (file-name-sans-extension x))
- (load (expand-file-name x))))
- (directory-files "." nil "\\`[a-z].*\\.el\\'"))))
+ (with-temp-buffer
+ (mapc (lambda (x)
+ (when (locate-library (file-name-sans-extension x))
+ (insert-file-contents (expand-file-name x))))
+ (directory-files "." nil "\\`[a-z].*\\.el\\'"))
+ (eval-buffer))))
--
Trent Buck
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-05-23 1:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-19 3:59 eval-after-load weirdness Trent Buck
2007-05-20 23:27 ` Trent Buck
[not found] ` <mailman.896.1179710457.32220.bug-gnu-emacs@gnu.org>
2007-05-22 22:59 ` Miles Bader
2007-05-23 1:46 ` Trent Buck
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.