emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `xterm-mouse-mode' has a bogus Custom group


From: Eli Zaretskii
Subject: Re: `xterm-mouse-mode' has a bogus Custom group
Date: Wed, 13 Apr 2005 08:21:30 +0300

> Date: Tue, 12 Apr 2005 20:24:49 -0500 (CDT)
> From: Luc Teirlinck <address@hidden>
> CC: address@hidden, address@hidden
> 
> 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.




reply via email to

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