[英]how to check if emacs in frame or in terminal?
基于这个问题: 如何将emacsclient背景设置为Emacs背景?
我只需要背景框架,而不是终端而不是控制台。
以下是我试图为控制台添加修复程序的方法
(when (display-graphic-p)
(tool-bar-mode -1)
(scroll-bar-mode t)
(require 'nyan-mode)
(nyan-mode)
(nyan-start-animation)
(mouse-wheel-mode t)
(setq default-frame-alist
'((background-color . "#101416")
(foreground-color . "#f6f3e8"))
)
)
但有了这个,我没有得到emacsclient的背景(即使是帧)。 也许检查甚至没有在emacsclient中运行?
基本上我不想在终端和控制台中添加背景到emacsclient但是在框架中。
(defun my-frame-config (frame)
"Custom behaviours for new frames."
(with-selected-frame frame
(when (display-graphic-p)
(set-background-color "#101416")
(set-foreground-color "#f6f3e8"))))
;; run now
(my-frame-config (selected-frame))
;; and later
(add-hook 'after-make-frame-functions 'my-frame-config)
也许更简单的解决方案是不触摸* -frame-alist,也不设置set-frame- *,而是触摸Mx customize-face RET默认RET然后中间点击“状态”按钮并选择“用于各种显示”此时,您将能够为不同的显示设置不同的面部外观。 UI的这一部分用得不多,它显示了,但你要做的是:中间点击INS插入第二组设置,然后在中间点击“显示”并选择“nil”,然后点击“Type”左侧的切换,然后是“TTY”左侧的切换:这使得第一组设置仅适用于tty帧,而另一组(可能仍然显示“Display:all”)适用到其余的情况(即非tty帧)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.