GNU bug report logs - #11585
24.0.50; corrupted byte compiled files

Previous Next

Package: emacs;

Reported by: Pierre Lorenzon <devel <at> pollock-nageoire.net>

Date: Wed, 30 May 2012 07:29:02 UTC

Severity: important

Found in version 24.0.50

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pierre Lorenzon <devel <at> pollock-nageoire.net>
To: 11585 <at> debbugs.gnu.org
Subject: bug#11585: 24.0.50; corrupted byte compiled files
Date: Wed, 30 May 2012 17:31:50 +0200 (CEST)
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#11585: 24.0.50; corrupted byte compiled files
Date: Wed, 30 May 2012 11:24:49 -0400

>> Certain of my .el files are incorrectly compiled. See the .elc
>> file with a long name.
> 
> Duh, indeed it was byte-compile-fix-header, thanks for investigating.
> I think your patch has the problem that it changes the byte-position of
> the text in the rest of the buffer, which will break lazy-loaded
> docstrings and byte-code.

  OK ! Anyway when I tried to load this .elc files compiled
  with my patch I encounter problem ....

  Pierre



> Can you try the patch below instead, which will simply report the actual
> load-file-name rather than file name of the source.
> 
> 
>         Stefan
> 
> 
> === modified file 'lisp/emacs-lisp/bytecomp.el'
> --- lisp/emacs-lisp/bytecomp.el	2012-05-30 03:59:42 +0000
> +++ lisp/emacs-lisp/bytecomp.el	2012-05-30 15:18:29 +0000
> @@ -1937,7 +1937,7 @@
>  	     (byte-compile-fix-header byte-compile-current-file))))
>       byte-compile--outbuffer)))
>  
> -(defun byte-compile-fix-header (filename)
> +(defun byte-compile-fix-header (_filename)
>    "If the current buffer has any multibyte characters, insert a version test."
>    (when (< (point-max) (position-bytes (point-max)))
>      (goto-char (point-min))
> @@ -1962,11 +1962,8 @@
>         ;; don't try to check the version number.
>         "     (< (aref emacs-version (1- (length emacs-version))) ?A)\n"
>         (format "     (string-lessp emacs-version \"%s\")\n" minimum-version)
> -       "     (error \"`"
> -       ;; prin1-to-string is used to quote backslashes.
> -       (substring (prin1-to-string (file-name-nondirectory filename))
> -		  1 -1)
> -       (format "' was compiled for Emacs %s or later\"))\n\n"
> +       "     (error \"`%s"
> +       (format "' was compiled for Emacs %s or later\" #$))\n\n"
>  	       minimum-version))
>        ;; Now compensate for any change in size, to make sure all
>        ;; positions in the file remain valid.
> @@ -2037,7 +2034,7 @@
>          (print-gensym t)
>          (print-circle                   ; Handle circular data structures.
>           (not byte-compile-disable-print-circle)))
> -    (if (and (memq (car-safe form) '(defun defmacro defvar defvaralias defconst
> +    (if (and (memq (car-safe form) '(defvar defvaralias defconst
>                                        autoload custom-declare-variable))
>               (stringp (nth 3 form)))
>          (byte-compile-output-docform nil nil '("\n(" 3 ")") form nil
> 




This bug report was last modified 13 years and 51 days ago.

Previous Next


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