From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pierre Lorenzon Newsgroups: gmane.emacs.bugs Subject: bug#11585: 24.0.50; corrupted byte compiled files Date: Wed, 30 May 2012 17:31:50 +0200 (CEST) Message-ID: <20120530.173150.291491535.devel@pollock-nageoire.net> References: <20120530.085706.183065156.devel@pollock-nageoire.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338392988 15271 80.91.229.3 (30 May 2012 15:49:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 May 2012 15:49:48 +0000 (UTC) To: 11585@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 30 17:49:47 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SZl9f-00051m-33 for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 May 2012 17:49:47 +0200 Original-Received: from localhost ([::1]:59433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZl9e-000194-TK for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 May 2012 11:49:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZl9Y-00017t-Ta for bug-gnu-emacs@gnu.org; Wed, 30 May 2012 11:49:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SZl9S-0004Xn-Cv for bug-gnu-emacs@gnu.org; Wed, 30 May 2012 11:49:40 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZl9S-0004XY-8x for bug-gnu-emacs@gnu.org; Wed, 30 May 2012 11:49:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SZlAs-00047Z-2J for bug-gnu-emacs@gnu.org; Wed, 30 May 2012 11:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pierre Lorenzon Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 May 2012 15:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11585 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11585-submit@debbugs.gnu.org id=B11585.133839306015833 (code B ref 11585); Wed, 30 May 2012 15:51:02 +0000 Original-Received: (at 11585) by debbugs.gnu.org; 30 May 2012 15:51:00 +0000 Original-Received: from localhost ([127.0.0.1]:50459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZlAp-00047K-L5 for submit@debbugs.gnu.org; Wed, 30 May 2012 11:50:59 -0400 Original-Received: from smtp07.smtpout.orange.fr ([80.12.242.129]:16906 helo=smtp.smtpout.orange.fr) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZlAo-000478-6Z for 11585@debbugs.gnu.org; Wed, 30 May 2012 11:50:59 -0400 Original-Received: from localhost ([86.195.134.210]) by mwinf5d14 with ME id GFpN1j00b4YY4DA03FpPde; Wed, 30 May 2012 17:49:23 +0200 In-Reply-To: X-Mailer: Mew version 6.2.51 on Emacs 24.0.50 / Mule 6.0 (HANACHIRUSATO) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:60529 Archived-At: From: Stefan Monnier 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 >