From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.bugs Subject: bug#7070: `load-time-value' local-vars this-kind and that-one Date: Sat, 18 Sep 2010 21:43:55 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1284862259 22445 80.91.229.12 (19 Sep 2010 02:10:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Sep 2010 02:10:59 +0000 (UTC) To: 7070@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 19 04:10:57 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ox9Ml-0004A5-NN for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Sep 2010 04:10:56 +0200 Original-Received: from localhost ([127.0.0.1]:49865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ox9Mk-0005k8-UL for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Sep 2010 22:10:54 -0400 Original-Received: from [140.186.70.92] (port=57006 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ox9Me-0005k2-BL for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 22:10:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ox9Mc-000397-TV for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 22:10:48 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43521) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ox9Mc-000393-S5 for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 22:10:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Ox8wj-0005Nn-Qn; Sat, 18 Sep 2010 21:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: MON KEY Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Sep 2010 01:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7070 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.128486060320681 (code B ref -1); Sun, 19 Sep 2010 01:44:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Sep 2010 01:43:23 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ox8w6-0005NW-Lx for submit@debbugs.gnu.org; Sat, 18 Sep 2010 21:43:22 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ox8w3-0005NP-V4 for submit@debbugs.gnu.org; Sat, 18 Sep 2010 21:43:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ox8yO-0000Zw-V0 for submit@debbugs.gnu.org; Sat, 18 Sep 2010 21:45:45 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:37085) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ox8yO-0000Zm-OA for submit@debbugs.gnu.org; Sat, 18 Sep 2010 21:45:44 -0400 Original-Received: from [140.186.70.92] (port=37273 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ox8yK-00012d-1Z for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 21:45:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ox8wg-0000Oi-4v for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 21:43:59 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:61508) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ox8wf-0000OX-VS for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2010 21:43:58 -0400 Original-Received: by wyb36 with SMTP id 36so4383495wyb.0 for ; Sat, 18 Sep 2010 18:43:55 -0700 (PDT) Original-Received: by 10.216.166.203 with SMTP id g53mr2819657wel.54.1284860635787; Sat, 18 Sep 2010 18:43:55 -0700 (PDT) Original-Received: by 10.216.65.140 with HTTP; Sat, 18 Sep 2010 18:43:55 -0700 (PDT) X-Google-Sender-Auth: jD_9CCSeeP7xvs9rQBIiXBKdCQM X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 18 Sep 2010 21:44:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:40300 Archived-At: current through BZR-101480 lisp/cl-macs.el macro `load-time-value' has this branch which if unsatisfied is supposed to fset `byte-compile-file-form': (and (fboundp 'byte-compile-file-form-defmumble) (boundp 'this-kind) (boundp 'that-one)) However, luckily the above doesn't happen. The only locations that bind the variables like this are in byte-compile-file-form-defmumble' e.g. the local letbound vars bytecomp-this-kind' and `bytecomp-that-one'. Until fairly recently (revision 94414) the symbols `this-kind' and and `that-one' were present in the bytecomp.el There is a comment about this which says: ,---- | ;; The `bytecomp-' prefix is applied to all local variables with | ;; otherwise common names in this and similar functions for the sake | ;; of the boundp test in byte-compile-variable-ref. | ;; http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg00237.html | ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-02/msg00134.html | ;; Note that similar considerations apply to command-line-1 in startup.el. `---- The symbols (this-kind and that-one) appear to have been changed here: ,---- | ------------------------------------------------------------ | revno: 96701 | committer: Glenn Morris | timestamp: Thu 2009-07-23 02:53:29 +0000 | message: | (byte-compile-from-buffer, byte-compile-output-file-form) | (byte-compile-output-docform, byte-compile-file-form-defmumble) | (byte-compile-output-as-comment): | Give some more local variables with common names a "bytecomp-" prefix, | so as not to shadow things during compilation. | ------------------------------------------------------------ | | ------------------------------------------------------------ | revno: 96702 | committer: Glenn Morris | timestamp: Thu 2009-07-23 02:54:00 +0000 | message: | (load-time-value): Update for the name-change `outbuffer' to | `bytecomp-outbuffer'. | ------------------------------------------------------------ | `---- Revision 96701 renamed the `byte-compile-file-form-defmumble's local vars: `this-kind' -> `bytecomp-this-kind' `this-one' -> `bytecomp-this-one' `that-one' -> `bytecomp-that-one' `outbuffer' -> `bytecomp-outbuffer' Revision 96702 renamed the `load-time-value' local var: `outbuffer' -> `bytecomp-outbuffer' but it appears to have left the `this-one' and `this-kind' vars unchanged. Unless I am misunderstanding/missing something either: a) some special magic that happens invisibily when Emacs is dumped and the current constraint is some sort of backward compatibility kludge; b) the macro never worked correctly; c) revisions at 96701/96702 created a bug where `load-time-value's can no longer alter via fset the function cell of `byte-compile-file-form' because the following constraint can not be satisfied; d) the macro never worked correctly and revisions at 96701/96702 created an additional bug; My money is on d. Right now if the macro is change to have the following form instead: (and (fboundp 'byte-compile-file-form-defmumble) (boundp 'bytecomp-this-kind) (boundp 'bytecomp-that-one)) `byte-compile-file-form' _can_ get rebound and this is not good. Moreover, even with this (further breaking) change I am not able to obtain the behavior described in the manual at: (info "(cl)Time of Evaluation") Is there some reason why the entire inner branch can't be elided with the macro written as: ,---- (lightly tested) | | (defmacro load-time-value (form &optional read-only) | "Like `progn', but evaluates the body at load time. | The result of the body appears to the compiler as a quoted constant." | (if (cl-compiling-file) | (print `(set ',(make-symbol "--cl-load-time--") ,@form) | (symbol-value 'bytecomp-outbuffer)) | `(eval ',form))) | `---- Also, what does the READ-ONLY arg do? The only possibility I can think of is that it somehow dovetails with the :read-only key in defstruct. -- /s_P\