[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cc-vars.el
From: |
Kim F. Storm |
Subject: |
Re: cc-vars.el |
Date: |
20 Nov 2002 17:37:40 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
"Stefan Monnier" <monnier+gnu/address@hidden> writes:
> > > But I also completely agree that we should try to make sure that pragmas
> > > as needed as rarely as possible, so I wholeheartedly support Dave's
> > > suggestion which will at least reduce the amount of useless warnings.
> >
> > One of the problems I've seen is with code which is conditioned to
> > differentiate between either gnu emacs and xemacs, or between different
> > os-types.
>
> This is irrelevant: Dave's patch doesn't impact those cases at all.
Off-topic, but not irrelevant IMO.
>
> > In the first case, many packages seem to have their own "xyz-xemacs-p"
> > function or variable, and the bytecompiler will surely have a hard time
> > determining whether a piece of code isn't used at all on this platform.
>
> And it shouldn't: the code should simply be fixed. In 90% of the
> time an fboundp check would be better (and Dave's patch would then have
> a chance of understanding what's going on).
True, but an fboundp check doesn't work in the cases where emacs and xemacs
functions have different parameter lists, such as display-completion-list.
>
> > A new built-in variable `emacs-type' (value = 'gnu-emacs or e.g. 'xemacs)
> > would fix this problem; for portability, packages may add the following
> > snippet to support older versions of gnu and xemacs:
>
> We don't want to encourage people to use brain dead tests like those.
> There's already (featurep 'xemacs) for such things.
That's good to know, thanks!!!
A quick scan shows that the following packages don't use the proper test:
bookmark.el, ediff.el, filesets.el, follow.el, ido.el,
iswitchb.el, ps-print.el, speedbar.el [partially], term.el,
type-break.el, edt, viper, eshell, net/eudc-bob.el, ada-mode.el,
cperl-mode.el, hideshow.el, octave-mod.el, flyspell.el, ispell.el
Even loaddefs.el has (defconst xemacsp ...) which comes from ispell.el
So the tests may be brain dead, but very popular...
> Maybe we should add to byte-opt.el the following snippet:
>
> (put 'featurep 'byte-optimizer 'byte-optimize-featurep)
> (defun byte-optimize-featurep (form)
> (if (equal '(featurep 'xemacs) form) nil form))
>
> since Emacs-21's byte-code won't work on XEmacs anyway, there's no
> point keeping XEmacs code around. It makes the code shorter and
> gets rid of a few warnings.
That's the right approach, yes. Please install it!
--
Kim F. Storm <address@hidden> http://www.cua.dk
- Re: cc-vars.el, (continued)
- Re: cc-vars.el, Dave Love, 2002/11/18
- Re: cc-vars.el, Martin Stjernholm, 2002/11/18
- Re: cc-vars.el, Miles Bader, 2002/11/18
- Re: cc-vars.el, Martin Stjernholm, 2002/11/19
- Re: cc-vars.el, Miles Bader, 2002/11/19
- Re: cc-vars.el, Martin Stjernholm, 2002/11/19
- Re: cc-vars.el, Miles Bader, 2002/11/19
- Re: cc-vars.el, Stefan Monnier, 2002/11/20
- Re: cc-vars.el, Kim F. Storm, 2002/11/20
- Re: cc-vars.el, Stefan Monnier, 2002/11/20
- Re: cc-vars.el,
Kim F. Storm <=
- Re: cc-vars.el, Dave Love, 2002/11/24
- Re: cc-vars.el, Dave Love, 2002/11/24
- Re: cc-vars.el, Miles Bader, 2002/11/20
- Re: cc-vars.el, Stefan Monnier, 2002/11/20
- Re: cc-vars.el, Martin Stjernholm, 2002/11/21
- Re: cc-vars.el, Richard Stallman, 2002/11/21
- Re: cc-vars.el, Stefan Monnier, 2002/11/21
- Re: cc-vars.el, Martin Stjernholm, 2002/11/21
- Re: cc-vars.el, Dave Love, 2002/11/20
- Re: cc-vars.el, Dave Love, 2002/11/20