all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Pierre Lorenzon <devel@pollock-nageoire.net>
Cc: 11585@debbugs.gnu.org
Subject: bug#11585: 24.0.50; corrupted byte compiled files
Date: Wed, 30 May 2012 11:24:49 -0400	[thread overview]
Message-ID: <jwv8vg9n18d.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20120530.085706.183065156.devel@pollock-nageoire.net> (Pierre Lorenzon's message of "Wed, 30 May 2012 08:57:06 +0200 (CEST)")

> 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.
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






  parent reply	other threads:[~2012-05-30 15:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30  6:57 bug#11585: 24.0.50; corrupted byte compiled files Pierre Lorenzon
     [not found] ` <handler.11585.B.133836288230357.ack@debbugs.gnu.org>
2012-05-30  8:05   ` bug#11585: Acknowledgement (24.0.50; corrupted byte compiled files) Pierre Lorenzon
2012-05-30  8:49     ` Pierre Lorenzon
2012-05-30 14:45 ` bug#11585: 24.0.50; corrupted byte compiled files Chong Yidong
2012-05-30 15:28   ` Pierre Lorenzon
2012-05-30 15:24 ` Stefan Monnier [this message]
2012-05-30 15:31   ` Pierre Lorenzon

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

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

  git send-email \
    --in-reply-to=jwv8vg9n18d.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=11585@debbugs.gnu.org \
    --cc=devel@pollock-nageoire.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.