From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62574 Path: news.gmane.org!not-for-mail From: Dave Love Newsgroups: gmane.emacs.gnus.general Subject: Re: use of (defvar ) Date: Fri, 07 Apr 2006 12:46:22 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1144410560 29848 80.91.229.2 (7 Apr 2006 11:49:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Apr 2006 11:49:20 +0000 (UTC) Original-X-From: ding-owner+m11101@lists.math.uh.edu Fri Apr 07 13:49:17 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FRpSg-0000AR-DJ for ding-account@gmane.org; Fri, 07 Apr 2006 13:49:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FRpSc-0003Qe-00; Fri, 07 Apr 2006 06:49:06 -0500 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FRpQ7-0003QZ-00 for ding@lists.math.uh.edu; Fri, 07 Apr 2006 06:46:31 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FRpQ5-0007Nz-OO for ding@lists.math.uh.edu; Fri, 07 Apr 2006 06:46:31 -0500 Original-Received: from s2.ukfsn.org ([217.158.120.143] helo=mail.ukfsn.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FRpQ0-0007PT-00 for ; Fri, 07 Apr 2006 13:46:24 +0200 Original-Received: from localhost (84-45-211-153.no-dns-yet.enta.net [84.45.211.153]) by mail.ukfsn.org (Postfix) with ESMTP id 84B95E7007 for ; Fri, 7 Apr 2006 12:43:29 +0100 (BST) Original-Received: from fx by localhost with local (Exim 4.60) (envelope-from ) id 1FRpPy-0005JH-Hr for ding@gnus.org; Fri, 07 Apr 2006 12:46:22 +0100 Original-To: ding@gnus.org X-Draft-From: ("nntp+news.gmane.org:gmane.emacs.gnus.general" 62561) In-Reply-To: (Reiner Steib's message of "Thu, 06 Apr 2006 21:58:16 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62574 Archived-At: Reiner Steib writes: > ,----[ http://article.gmane.org/gmane.emacs.devel/43027 ] > | From: Richard M. Stallman > | Subject: Re: defvars at compile time > | > | The only effect of a defvar with no initial value > | is to silence the compiler. So it is superfluous > | to put it inside eval-when-compile. > `---- That's certainly not true in Emacs 21: (progn (with-temp-file "/tmp/x.el" (insert "(defvar foo)\n")) (byte-compile-file "/tmp/x.el") (with-temp-buffer=20 (insert-file-contents-literally "/tmp/x.elc") (goto-char (point-max)) (delete-region 1 (line-beginning-position 0)) (buffer-string))) =3D> "(byte-code \"\\301=08B=10\\301\\207\" [current-load-list foo] 2) " You can completely screw Emacs if you unload a feature that does that on important variables. It also causes confusion with find-function & al. I fixed a fair number of cases in the Emacs source that could clobber things like `font-lock-keywords' and documented using eval-when-compile in the Lisp manual. I don't remember what the justification was for the one-arg defvar modifying the load history at the time; that sort of policy decision often gets reversed.