【问题标题】:different custom theme (NOT color theme) per emacs frame?每个 emacs 框架有不同的自定义主题(不是颜色主题)?
【发布时间】:2015-02-12 16:11:14
【问题描述】:

我正在尝试让 Emacs (v24.3.1) 在创建的框架中加载新的自定义主题。也就是说,我的初始帧中有我的默认主题,所有后续帧都应该有一个单独的主题(让我可以轻松识别初始帧)。

这是我目前所拥有的:

;make new frames use a different custom theme
(defun apply-custom-theme (frame)
  "Apply custom theme to a frame based on whether its a 'real'
   window or a console window."
  (select-frame frame)
  (if (window-system frame)
      (load-theme 'light-blue t)
    (load-theme 'tango-black t)))
(add-hook 'after-make-frame-functions 'apply-custom-theme)

这可行,除了加载的主题会影响所有帧,包括初始帧。 [我知道即使没有我的钩子,一帧中的“加载主题”也会影响所有帧。]

我知道我可以使用旧的颜色主题工具来实现这个目标......我很想知道它是否也可以使用 Emacs 24x 自定义主题来完成(这将允许轻松创建和自定义新主题,其中其他东西)。

【问题讨论】:

  • 这对你的问题没有帮助,但你可以用(load-theme (if (window-system frame) 'light-blue 'tango-black) t)缩短你的代码。
  • 不幸的是,如果您在守护程序模式下运行 emacs 并且希望为您的 GUI 设置主题而不是为您的终端设置主题,那么这将成为一个真正的问题。即使我遇到了这个问题,然后放弃了。另一种方法是启动 emacs 守护程序并以反向视频模式启动 emacsclient,但 emacs 客户端没有标志。

标签: emacs elisp


【解决方案1】:

目前,我认为自定义主题支持无法实现特定于框架的主题。它可能支持(通过一些额外的编码)为不同的种类帧使用不同的主题(例如,一个主题用于 tty,另一个用于 X11),虽然。

我建议您 M-x report-emacs-bug 为这种情况申请新的(一组)功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-19
    • 1970-01-01
    相关资源
    最近更新 更多