如何检查框架内或终端中的emacs?

时间:2012-02-15 04:16:51

标签: linux emacs elisp emacsclient

基于这个问题:How to set emacsclient background as Emacs background?

我只需要帧的背景,而不是终端而不是控制台。

以下是我尝试添加修复程序

的方法
(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,但是在框架中。

2 个答案:

答案 0 :(得分:4)

(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)

答案 1 :(得分:2)

也许更简单的解决方案是不要触摸 * -frame-alist,也不要触摸set-frame- *,而是触摸Mx customize-face RET默认RET然后中间点击“状态”按钮并选择“对于所有类型的显示”,此时您将能够为不同的显示设置不同的面部外观。 UI的这一部分使用不多,它显示,但你会这样做: 中间单击INS以插入第二组设置,然后在“显示”上单击鼠标中键并选择“nil”,然后单击“类型”左侧的切换,然后单击“TTY”左侧的切换。 :这使得第一组设置仅适用于tty帧,而另一组(可能仍然显示“Display:all”)适用于其余情况(即非tty帧)。