From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Problem mit symlinks, locate-library and load-history [Was: ] Date: Sun, 19 Mar 2006 22:19:02 +0000 (GMT) Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1142806690 27178 80.91.229.2 (19 Mar 2006 22:18:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 19 Mar 2006 22:18:10 +0000 (UTC) Cc: bug-cc-mode@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 19 23:18:09 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FL6Dw-00087H-Oz for ged-emacs-devel@m.gmane.org; Sun, 19 Mar 2006 23:18:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FL6Dw-00008A-7d for ged-emacs-devel@m.gmane.org; Sun, 19 Mar 2006 17:18:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FL6Dk-00007o-6E for emacs-devel@gnu.org; Sun, 19 Mar 2006 17:17:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FL6Dj-00007V-4x for emacs-devel@gnu.org; Sun, 19 Mar 2006 17:17:55 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FL6Dj-00007R-0K for emacs-devel@gnu.org; Sun, 19 Mar 2006 17:17:55 -0500 Original-Received: from [193.149.49.134] (helo=acm.acm) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FL6J3-00085w-Pf; Sun, 19 Mar 2006 17:23:26 -0500 Original-Received: from localhost (root@localhost) by acm.acm (8.8.8/8.8.8) with SMTP id WAA01099; Sun, 19 Mar 2006 22:19:03 GMT X-Sender: root@acm.acm Original-To: emacs-devel@gnu.org In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:51865 Archived-At: 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)