[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 16:43:42 +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.
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.
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:
(unless (boundp 'emacs-type)
(setq emacs-type
(cond ((string-match "XEmacs" (emacs-version)) 'xemacs)
(t 'gnu-emacs))))
In this case, I think it is ok for the byte-compiler to simply ignore
all errors in the "other type of emacs" branch.
In the second case, code may do one of the following:
(if (eq system-type 'msdos) ;; or using cond
(msdos-function ...))
or
(if (fboundp 'msdos-function)
(msdos-function ...))
The problem here is that the byte-compiled file must actually work on
msdos even when byte-compiled on, say, gnu/linux. Maybe we could add
a list of prototypes for built-in platform specific functions in the
byte-compiler.
--
Kim F. Storm <address@hidden> http://www.cua.dk
- Re: cc-vars.el, Kenichi Handa, 2002/11/17
- Re: cc-vars.el, Richard Stallman, 2002/11/18
- 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 <=
- Re: cc-vars.el, Stefan Monnier, 2002/11/20
- Re: cc-vars.el, Kim F. Storm, 2002/11/20
- 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