[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem mit symlinks, locate-library and load-history [Was: <Something e
From: |
Alan Mackenzie |
Subject: |
Problem mit symlinks, locate-library and load-history [Was: <Something else>] |
Date: |
Sun, 19 Mar 2006 22:19:02 +0000 (GMT) |
Hi, Emacs!
On Tue, 14 Mar 2006, Alan Mackenzie wrote in an article with Subject: "CC
Mode: File mode specification error: (void-variable
c-font-lock-keywords-3)":
>Hi, Emacs and CC Mode!
>
>Start Emacs 22 with -Q, then visit a file.c.
>
>Emacs displays the message:
>
> File mode specification error: (void-variable c-font-lock-keywords-3)
>
>. Probably that variable needs an autoload on it, or something like
>that. Please consider the bug as noted by CC Mode, and that it will be
>fixed in the next (minor) release.
This problem happens with the form
(eval-after-load "font-lock" '(require cc-fonts))
in cc-mode.el. eval-after-load calls (locate-library "font-lock"), which
returns
"/home/acm/emacs/emacs/lisp/font-lock.elc"
, which it then tries, with (assoc (locate-library file) load-history), to
match against
"/mnt/hda7/emacs/lisp/font-lock.el"
, and fails. There are two distinct problems here:
(i) locate-library gives a .elc, but there's a .el in load-history.
(ii) /home/acm/emacs is actually a symbolic link pointing at /mnt/hda7.
My reactions:
(i) The dumped lisp files are byte compiled, so it seems strange indeed
that font-lock.el is record in load-history rather than font-lock.elc.
Is this a bug?
(ii) Why on earth is eval-after-load converting "font-lock" to a full
filename and then searching for that? Surely it is sufficient that any
old font-lock has been loaded at some time (e.g., at dump time)?
On the other hand, if absolute pathnames are to be used, shouldn't they
first be filtered with file-truename, like this:
*** subr.el Sun Feb 19 12:50:45 2006
--- subr.acm.el Sun Mar 19 22:00:15 2006
***************
*** 1378,1384 ****
;; Emacs for the case that FILE is one of them.
;; (load-symbol-file-load-history)
(when (locate-library file)
! (assoc (locate-library file) load-history)))
(eval form))))
form)
--- 1378,1384 ----
;; Emacs for the case that FILE is one of them.
;; (load-symbol-file-load-history)
(when (locate-library file)
! (assoc (file-truename (locate-library file)) load-history)))
(eval form))))
form)
There are approximately 45 places in ..../lisp where locate-library is
used, and approximately none of them use file-truename. 3 of these are
assoc'king the result with load-history.
--
Alan Mackenzie (Munich, Germany)