From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62593 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: use of (defvar ) Date: Fri, 07 Apr 2006 16:45:43 -0400 Message-ID: <87lkuhdsyb.fsf-monnier+emacs@gnu.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1144442816 24801 80.91.229.2 (7 Apr 2006 20:46:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Apr 2006 20:46:56 +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 22:46:52 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 1FRxqM-0004dv-Ux for ged-emacs-devel@m.gmane.org; Fri, 07 Apr 2006 22:46:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FRxqM-0008Ok-H2 for ged-emacs-devel@m.gmane.org; Fri, 07 Apr 2006 16:46:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FRxq9-0008Oe-5a for emacs-devel@gnu.org; Fri, 07 Apr 2006 16:45:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FRxq5-0008MV-Lo for emacs-devel@gnu.org; Fri, 07 Apr 2006 16:45:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FRxq5-0008ML-IX for emacs-devel@gnu.org; Fri, 07 Apr 2006 16:45:53 -0400 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FRxu5-0008Vp-Qh; Fri, 07 Apr 2006 16:50:02 -0400 Original-Received: from alfajor ([70.55.147.51]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060407204549.RRRH13653.tomts36-srv.bellnexxia.net@alfajor>; Fri, 7 Apr 2006 16:45:49 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 6D55FD8679; Fri, 7 Apr 2006 16:45:43 -0400 (EDT) Original-To: Dave Love In-Reply-To: (Reiner Steib's message of "Fri, 07 Apr 2006 21:07:48 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:52512 gmane.emacs.gnus.general:62593 Archived-At: > 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.) >>From the future's point of view (Emacs-22 and up), placing such defvars inside eval-when-compile is a bad practice (in the future it may even fail to work since there's nothing that guarantees that the content of eval-when-compile is actually compiled rather than just eval'd). In Emacs-21 and older, such a defvar will have some undesirable minor side-effects (via the load-history) unless it is placed inside an eval-when-compile *and* the file is byte-compiled. Indeed placing the defvar inside the eval-when-compile has no effect if the file is not byte-compiled. I'd recommend to not use eval-when-compile since that's what many packages have been doing for many years without suffering much (if ever) of the occasional side-effects (which only affect unload-feature and sometimes C-h v). But it's your call, really. Stefan