GNU bug report logs - #5303
23.1.91; Cannot load .emacs-history from savehist.el

Previous Next

Packages: emacs, w32;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Tue, 5 Jan 2010 14:09:02 UTC

Severity: normal

Merged with 5309

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: bug-gnu-emacs <at> gnu.org (Emacs bug Tracking System)
To: "Drew Adams" <drew.adams <at> oracle.com>
Subject: bug#5303 closed by Eli Zaretskii <eliz <at> gnu.org> (Re: bug#5303:
 23.1.91; Cannot load .emacs-history from savehist.el)
Date: Fri, 22 Jan 2010 08:55:04 +0000
[Message part 1 (text/plain, inline)]
This is an automatic notification regarding your bug report
which was filed against the emacs,w32 package:

#5303: 23.1.91; Cannot load .emacs-history from savehist.el

It has been closed by Eli Zaretskii <eliz <at> gnu.org>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Eli Zaretskii <eliz <at> gnu.org> by
replying to this email.


-- 
5303: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5303
Emacs Bug Tracking System
Contact bug-gnu-emacs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 5303-done <at> debbugs.gnu.org, michael.albinus <at> gmx.de, monnier <at> IRO.UMontreal.CA,
	rms <at> gnu.org
Subject: Re: bug#5303: 23.1.91; Cannot load .emacs-history from savehist.el
Date: Fri, 22 Jan 2010 10:54:42 +0200
> From: Chong Yidong <cyd <at> stupidchicken.com>
> Cc: 5303 <at> debbugs.gnu.org, michael.albinus <at> gmx.de,
>         Stefan Monnier <monnier <at> IRO.UMontreal.CA>,
>         Richard Stallman <rms <at> gnu.org>
> Date: Thu, 21 Jan 2010 15:41:06 -0500
> 
> Chong Yidong <cyd <at> stupidchicken.com> writes:
> 
> >>   . Was safe_to_load_p intended to return non-zero value for invalid
> >>     file descriptors such as -2?
> >
> > I think that is a bug.
> 
> Does it fix the bug if safe_to_load_p returns 0 when the call to
> emacs_read on line 895 returns a value <= 0?

It does, but I prefer not to call safe_to_load_p at all in that case.
I've installed a slightly different fix, see below.

(There's another, possibly similar bug: load-file fails for
C:/the-file.el.gz because jka-compr signals a wrong type argument
error.  But that problem existed with the original Fload as well.  I
will file a separate bug and see what I can find there.)

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

	* lread.c (Fload): Don't treat files without .elc extension as
	byte-compiled if they are ``magic'', i.e. `openp' returned -2 for
	them.  (bug#5303)

=== modified file 'src/lread.c'
--- src/lread.c	2010-01-13 08:35:10 +0000
+++ src/lread.c	2010-01-22 08:35:48 +0000
@@ -1155,7 +1155,7 @@ Return t if the file exists and loads su
 
   if (!bcmp (SDATA (found) + SBYTES (found) - 4,
 	     ".elc", 4)
-      || (version = safe_to_load_p (fd)) > 0)
+      || (fd >= 0 && (version = safe_to_load_p (fd)) > 0))
     /* Load .elc files directly, but not when they are
        remote and have no handler!  */
     {


[Message part 3 (message/rfc822, inline)]
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <emacs-pretest-bug <at> gnu.org>
Subject: 23.1.91; Cannot load .emacs-history from savehist.el
Date: Sun, 3 Jan 2010 11:13:30 -0800
[Message part 4 (text/plain, inline)]
emacs -Q
Trying to load the attached file raises the error "End of file during
parsing: c:/.emacs-history".
 
There is no real end-of-file problem, however: This file was created by
savehist.el using Emacs 23.1, and it loads fine in all releases of Emacs
(20 through 23).  An error is raised only for the Emacs 23.1.91.1
pretest.

NOTE: I had to attach a copy of the original file, because Windows doesn't allow
me to attach a file named `.emacs-history'. But trying to load that copy,
`emacs-history', also raises the same error.

However, something weird is going on. If the file is in c:/ when I try to load
it, then the error is raised. If the file is in c:/mydir/ when I try to load it,
then it loads with no error. I do not understand this at all. Exactly the same
file, different behavior. And it doesn't matter whether I make the file copy
using Emacs C-x C-w or using Windows copy+paste.
 
Dunno if simply attaching the file will enable you to reproduce
the bug - hope so.

 
In GNU Emacs 23.1.91.1 (i386-mingw-nt5.1.2600)
 of 2010-01-02 on PRETEST
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'

[emacs-history (application/octet-stream, attachment)]

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

Previous Next


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