unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
Cc: bug-cc-mode@gnu.org
Subject: Problem mit symlinks, locate-library and load-history [Was: <Something else>]
Date: Sun, 19 Mar 2006 22:19:02 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.3.96.1060319213206.408A-100000@acm.acm> (raw)
In-Reply-To: <Pine.LNX.3.96.1060314112515.335A-100000@acm.acm>

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)

  reply	other threads:[~2006-03-19 22:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14 11:30 CC Mode: File mode specification error: (void-variable c-font-lock-keywords-3) Alan Mackenzie
2006-03-19 22:19 ` Alan Mackenzie [this message]
2006-03-21  1:02   ` Problem mit symlinks, locate-library and load-history [Was: <Something else>] Richard Stallman
2006-03-21 14:26     ` Problem mit symlinks, locate-library and load-history Alan Mackenzie
2006-03-21 14:56       ` Stefan Monnier
2006-03-22 14:04     ` Problem mit symlinks, locate-library and load-history [Was: <Something else>] Alan Mackenzie
2006-03-27  8:36       ` Richard Stallman
2006-05-10 11:18         ` Problem mit symlinks, locate-library and load-history [PATCH] Alan Mackenzie

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.3.96.1060319213206.408A-100000@acm.acm \
    --to=acm@muc.de \
    --cc=bug-cc-mode@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).