GNU bug report logs - #5447
23.1.91; load-file fails for C:/the-file.el.gz

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Fri, 22 Jan 2010 09:03:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 5447-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 5447-done <at> debbugs.gnu.org
Subject: Re: bug#5447: 23.1.91; load-file fails for C:/the-file.el.gz
Date: Fri, 22 Jan 2010 12:32:52 +0200
> Date: Fri, 22 Jan 2010 11:01:59 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 
> 
>  emacs -Q
>  M-x load-file RET C:/the-file.el.gz RET
> 
> This signals an error: Wrong type argument: consp, nil.  The traceback
> is as follows:
> 
>   Debugger entered--Lisp error: (wrong-type-argument consp nil)
>     jka-compr-load("c:/the-file.el.gz" nil nil t)
>     apply(jka-compr-load ("c:/the-file.el.gz" nil nil t))
>     jka-compr-handler(load "c:/the-file.el.gz" nil nil t)
>     load("c:/the-file.el.gz" nil nil t)
>     load-file("c:/the-file.el.gz")
>     call-interactively(load-file t nil)
>     execute-extended-command(nil)
>     call-interactively(execute-extended-command nil nil)

Fixed with the patch below.  The interesting thing is that
jka-compr-load is not even called if the file is not in the root
directory of a drive.  I will try to look into that now.

Should we perhaps run $TEMP etc. through file-truename when we compute
the value of temporary-file-directory?

2010-01-22  Eli Zaretskii  <eliz <at> gnu.org>

	* jka-compr.el (jka-compr-load): If load-file is not in
	load-history, try its file-truename version.  (bug#5447)

=== modified file 'lisp/jka-compr.el'
--- lisp/jka-compr.el	2010-01-13 08:35:10 +0000
+++ lisp/jka-compr.el	2010-01-22 10:19:39 +0000
@@ -590,7 +590,14 @@ There should be no more than seven chara
 	  (or nomessage
 	      (message "Loading %s...done." file))
 	  ;; Fix up the load history to point at the right library.
-	  (let ((l (assoc load-file load-history)))
+	  (let ((l (or (assoc load-file load-history)
+		       ;; On MS-Windows, if load-file is in
+		       ;; temporary-file-directory, it will look like
+		       ;; "c:/DOCUME~1/USER/LOCALS~1/foo", whereas
+		       ;; readevalloop will record its truename in
+		       ;; load-history.  Therefore try truename if the
+		       ;; original name is not in load-history.
+		       (assoc (file-truename load-file) load-history))))
 	    ;; Remove .gz and .elc?.
 	    (while (file-name-extension file)
 	      (setq file (file-name-sans-extension file)))





This bug report was last modified 15 years and 125 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.