简体   繁体   English

查看cygwin emacs是否在emacs中的X下运行

[英]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). 在emacs-nox.exe和emacs.exe(在X下运行)下设置为“cygwin”。 How to find if a emacs is running inside X. 如何查找emacs是否在X内运行。

Try calling the function window-system . 尝试调用函数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.

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. AFAIK的Cygwin-X11版本的Emacs就像GNU / Linux版本一样,它可以同时拥有tty帧和X11帧。

So even when you start "emacs -nw", you can later on create X11 frames from that same Emacs instance (eg via emacsclient or via Mx make-frame-on-display ). 因此,即使您启动“emacs -nw”,您也可以稍后从同一个Emacs实例创建X11帧(例如,通过emacsclient或通过Mx 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. 这意味着,如果您希望该案例运行良好,您需要应用“非X11”自定义,即使在“非X11”情况下,您可能希望这样做只会影响X11帧而不是tty帧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM