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 17:37:40 +0100 Sender: emacs-devel-admin@gnu.org Message-ID: <5x7kf8yz6z.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> <5xbs4kz1ox.fsf@kfs2.cua.dk> <200211201501.gAKF1Jo21597@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 1037806607 30303 80.91.224.249 (20 Nov 2002 15:36:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2002 15:36:47 +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 18EWu9-0007rx-00 for ; Wed, 20 Nov 2002 16:36:41 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18EWxO-0006kN-00 for ; Wed, 20 Nov 2002 16:40:02 +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 18EWvo-0007sD-00; Wed, 20 Nov 2002 10:38:24 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18EWvN-0007L4-00 for emacs-devel@gnu.org; Wed, 20 Nov 2002 10:37:57 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18EWvJ-0007Fv-00 for emacs-devel@gnu.org; Wed, 20 Nov 2002 10:37:56 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18EWvI-0007EO-00; Wed, 20 Nov 2002 10:37:53 -0500 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id 2B0407C017; Wed, 20 Nov 2002 15:37:51 +0000 (GMT) Original-To: "Stefan Monnier" In-Reply-To: <200211201501.gAKF1Jo21597@rum.cs.yale.edu> Original-Lines: 61 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:9566 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9566 "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. > > 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 http://www.cua.dk