変数
"system-type"
emacs-nox.exeとemacs.exe(Xで実行)の両方で「cygwin」に設定されます。emacsがX内で実行されているかどうかを確認する方法。
関数を呼び出してみてくださいwindow-system
。docstring は次のように述べています。
(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.
AFAIK Cygwin-X11バージョンのEmacsは、ttyフレームとX11フレームの両方を同時に持つことができるという点でGNU/Linuxバージョンと同じです。
したがって、「emacs -nw」を開始した場合でも、後で同じEmacsインスタンスからX11フレームを作成できます(たとえば、viaemacsclient
またはvia M-x make-frame-on-display
)。つまり、そのケースを適切に機能させるには、「非X11」の場合でも「X11のみ」のカスタマイズを適用する必要があります。これは、X11フレームにのみ影響するようにする必要があります。 ttyフレームではありません。