From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.devel Subject: Re: `xterm-mouse-mode' has a bogus Custom group Date: Wed, 13 Apr 2005 08:21:30 +0300 Message-ID: <01c53fe8$Blat.v2.4$cb63b900@zahav.net.il> References: <200504020351.j323ppS16391@raven.dms.auburn.edu> <16974.11752.332998.125628@farnswood.snap.net.nz> <200504021346.j32Dk3e19471@raven.dms.auburn.edu> <16978.12100.857894.861739@farnswood.snap.net.nz> <200504060000.j3600bm15264@raven.dms.auburn.edu> <16979.20638.871209.55398@farnswood.snap.net.nz> <200504070045.j370j0J27252@raven.dms.auburn.edu> <16981.58243.428189.615765@farnswood.snap.net.nz> <200504081605.j38G5ia15320@raven.dms.auburn.edu> <16982.64939.154130.463783@farnswood.snap.net.nz> <200504090406.j3946HQ22712@raven.dms.auburn.edu> <01c53d89$Blat.v2.4$96f0bb20@zahav.net.il> <200504101318.j3ADID528159@raven.dms.auburn.edu> <200504120104.j3C14tS11315@raven.dms.auburn.edu> <200504130124.j3D1Onf19799@raven.d Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1113370115 31530 80.91.229.2 (13 Apr 2005 05:28:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Apr 2005 05:28:35 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 13 07:28:32 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DLaQK-0001GD-EV for ged-emacs-devel@m.gmane.org; Wed, 13 Apr 2005 07:28:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DLZzy-0006by-8d for ged-emacs-devel@m.gmane.org; Wed, 13 Apr 2005 01:01:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DLZzQ-0006UC-HG for emacs-devel@gnu.org; Wed, 13 Apr 2005 01:00:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DLZzF-0006OU-VH for emacs-devel@gnu.org; Wed, 13 Apr 2005 01:00:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DLZzF-0006O5-QD for emacs-devel@gnu.org; Wed, 13 Apr 2005 01:00:25 -0400 Original-Received: from [192.114.186.24] (helo=legolas.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DLaOR-0007PT-LS for emacs-devel@gnu.org; Wed, 13 Apr 2005 01:26:27 -0400 Original-Received: from zaretski (IGLD-84-228-140-110.inter.net.il [84.228.140.110]) by legolas.inter.net.il (MOS 3.5.6-GR) with ESMTP id EDG57666 (AUTH halo1); Wed, 13 Apr 2005 08:25:58 +0300 (IDT) Original-To: Luc Teirlinck X-Mailer: emacs 22.0.50 (via feedmail 8 I) and Blat ver 2.4 In-reply-to: <200504130124.j3D1Onf19799@raven.dms.auburn.edu> (message from Luc Teirlinck on Tue, 12 Apr 2005 20:24:49 -0500 (CDT)) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:35926 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35926 > Date: Tue, 12 Apr 2005 20:24:49 -0500 (CDT) > From: Luc Teirlinck > CC: eliz@gnu.org, emacs-devel@gnu.org > > I guess that you check for MSDOS with `(eq system-type 'ms-dos)' from > Lisp and with `#ifdef MSDOS' from C. Only if no other good method exists. Usually, testing some function to be fboundp is a much better method. For example, here's how startup.el figures out that it runs on MSDOS or a text terminal with no X support compiled in (thus, no primitive support for tooltips): (unless (or noninteractive emacs-quick-startup (not (display-graphic-p)) (not (fboundp 'x-show-tip))) (tooltip-mode 1)) The last 2 conditions is what you are looking for. This is much cleaner, as no OS names are mentioned, just the functionality you need for the call you are about to make. > But how do you check whether configure was invoked with `--without-x' > from Lisp and from C? See above: find some related C function with Lisp binding that is only compiled in when X support is enabled, and test for it with fboundp. That's for Lisp code; for C, Jan showed you the way.