[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: use of (defvar <foo>)
From: |
Bill Wohler |
Subject: |
Re: use of (defvar <foo>) |
Date: |
Fri, 07 Apr 2006 16:48:16 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> Could people on emacs-devel please comment on this?
>> Should we use (defvar <foo>) or (eval-when-compile (defvar <foo>)) 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.
I was planning on stripping the eval-when-compile defvar wrappers for
the MH-E 8.0/Emacs 22.1 release. Reiner, is the problem you describe
real or theoretical?
--
Bill Wohler <address@hidden> http://www.newt.com/wohler/ GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.
- Re: use of (defvar <foo>), Reiner Steib, 2006/04/07
- Re: use of (defvar <foo>), Stefan Monnier, 2006/04/07
- Re: use of (defvar <foo>),
Bill Wohler <=
- Re: use of (defvar <foo>), Dave Love, 2006/04/09
- Re: use of (defvar <foo>), Stefan Monnier, 2006/04/09
- Re: use of (defvar <foo>), Dave Love, 2006/04/11
- Re: use of (defvar <foo>), David Kastrup, 2006/04/11
- Re: use of (defvar <foo>), Dave Love, 2006/04/13
- Re: use of (defvar <foo>), Stefan Monnier, 2006/04/11
- Re: use of (defvar <foo>), Dave Love, 2006/04/13
Re: use of (defvar <foo>), Richard Stallman, 2006/04/08