From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62592 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: use of (defvar ) Date: Fri, 07 Apr 2006 21:07:48 +0200 Message-ID: References: Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1144436909 4181 80.91.229.2 (7 Apr 2006 19:08:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Apr 2006 19:08:29 +0000 (UTC) Cc: ding@gnus.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 07 21:08:25 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FRwJf-00050l-LP for ged-emacs-devel@m.gmane.org; Fri, 07 Apr 2006 21:08:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FRwJf-0007c7-7H for ged-emacs-devel@m.gmane.org; Fri, 07 Apr 2006 15:08:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FRwJU-0007ay-6u for emacs-devel@gnu.org; Fri, 07 Apr 2006 15:08:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FRwJS-0007Z9-Qi for emacs-devel@gnu.org; Fri, 07 Apr 2006 15:08:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FRwJS-0007Z1-FZ for emacs-devel@gnu.org; Fri, 07 Apr 2006 15:08:06 -0400 Original-Received: from [134.60.1.1] (helo=mail.uni-ulm.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FRwNF-0001vI-0f; Fri, 07 Apr 2006 15:12:01 -0400 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.13.6/8.13.6) with ESMTP id k37J7nvm029165; Fri, 7 Apr 2006 21:07:49 +0200 (MEST) Original-Received: by bridgekeeper.physik.uni-ulm.de (Postfix, from userid 170) id E1B9E1167C; Fri, 7 Apr 2006 21:07:48 +0200 (CEST) Original-To: Dave Love Mail-Followup-To: Dave Love , ding@gnus.org, emacs-devel@gnu.org X-Face: /U7=m^"/-Dn61mAl{g9e3>\G5Tp,oEX|V)g2I1hBk\ML; )7A?6cmB-y7y?'NA^J<=oz7syB =(McAwIHgLX!.B?R3X}98d@?>CrT094KLWh]WU4gDpnL/")MS(XoQTv`Oq225uL>+; CpPXo$N5e>N> $tPd-gbB^F{gQS#1ase]XO~D4p4M"3+F-7~u]dy3I?Pb8RO*H-EFeWDUf?Rf, d]pv\Jvh2Cht!A=im yKAS2Z%Ao^;}W/qzMvMm In-Reply-To: (Dave Love's message of "Fri, 07 Apr 2006 12:46:22 +0100") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-DCC-EATSERVER-Metrics: gemini 1166; Body=3 Fuz1=3 Fuz2=3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52511 gmane.emacs.gnus.general:62592 Archived-At: On Fri, Apr 07 2006, Dave Love wrote on ding@gnus.org: > Reiner Steib writes: [ Quote from initial mail added for emacs-devel ] >> On Thu, Apr 06 2006, Dave Love wrote: >>> Gnus has lots of instances of `(defvar )' that aren't protected >>> by `eval-when-compile' and should be. >> ,----[ 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 > (insert-file-contents-literally "/tmp/x.elc") > (goto-char (point-max)) > (delete-region 1 (line-beginning-position 0)) > (buffer-string))) > => "(byte-code \"\\301B\\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. Could people on emacs-devel please comment on this? Should we use (defvar ) or (eval-when-compile (defvar )) in Gnus for compatibility with Emacs 21? (Probably the same holds for MH-E.) Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/