> Date: Tue, 12 Apr 2005 20:24:49 -0500 (CDT)
> From: Luc Teirlinck <[EMAIL PROTECTED]>
> CC: [EMAIL PROTECTED], 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.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to