Talespin_Kit
Talespin_Kit

Reputation: 21877

Find if cygwin emacs is running under X within emacs

The variable

"system-type"

is set to "cygwin" under both of emacs-nox.exe and emacs.exe(running under X). How to find if a emacs is running inside X.

Upvotes: 1

Views: 199

Answers (2)

Stefan
Stefan

Reputation: 28541

AFAIK the Cygwin-X11 version of Emacs is just like the GNU/Linux version in that it can have both tty frames and X11 frames at the same time.

So even when you start "emacs -nw", you can later on create X11 frames from that same Emacs instance (e.g. via emacsclient or via M-x make-frame-on-display). Which means that if you want that case to work well, you need to apply your "X11-only" customizations even in the "non-X11" case, tho you might like to do it in such a way that it only affects X11 frames and not tty frames.

Upvotes: 1

legoscia
legoscia

Reputation: 41578

Try calling the function window-system. The docstring says:

(window-system &optional FRAME)

The name of the window system that FRAME is displaying through.
The value is a symbol:
 nil for a termcap frame (a character-only terminal),
 'x' for an Emacs frame that is really an X window,
 'w32' for an Emacs frame that is a window on MS-Windows display,
 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
 'pc' for a direct-write MS-DOS frame.

FRAME defaults to the currently selected frame.

Use of this function as a predicate is deprecated.  Instead,
use `display-graphic-p' or any of the other `display-*-p'
predicates which report frame's specific UI-related capabilities.

Upvotes: 3

Related Questions