[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

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 ...))

        (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

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]