From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: cc-vars.el Date: 20 Nov 2002 16:43:42 +0100 Sender: emacs-devel-admin@gnu.org Message-ID: <5xbs4kz1ox.fsf@kfs2.cua.dk> References: <200211180057.JAA24537@etlken.m17n.org> <5bbs4m8qz9.fsf@lister.roxen.com> <5bwun97ecw.fsf@lister.roxen.com> <20021119165749.GA27657@gnu.org> <5b65utkyqt.fsf@lister.roxen.com> <200211201358.gAKDwsG21304@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1037803446 15988 80.91.224.249 (20 Nov 2002 14:44:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2002 14:44:06 +0000 (UTC) Cc: Miles Bader , Martin Stjernholm , Dave Love , Kenichi Handa , rms@gnu.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18EW5A-00049N-00 for ; Wed, 20 Nov 2002 15:44:00 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18EW8P-0006GT-00 for ; Wed, 20 Nov 2002 15:47:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18EW5a-0007ct-00; Wed, 20 Nov 2002 09:44:26 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18EW58-0006o8-00 for emacs-devel@gnu.org; Wed, 20 Nov 2002 09:43:58 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18EW54-0006hz-00 for emacs-devel@gnu.org; Wed, 20 Nov 2002 09:43:57 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18EW54-0006h3-00; Wed, 20 Nov 2002 09:43:54 -0500 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id B37337C017; Wed, 20 Nov 2002 14:43:52 +0000 (GMT) Original-To: "Stefan Monnier" In-Reply-To: <200211201358.gAKDwsG21304@rum.cs.yale.edu> Original-Lines: 43 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9564 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9564 "Stefan Monnier" 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 http://www.cua.dk