emacs - Emacs主题定义中,为什么会有(t ( :background "black"))

标签 emacs elisp

enter image description here

为什么主题定义包含类似 (t (:background "black")) 的结构? t 的作用是什么?

最佳答案

sexp ((t (:foreground ... ))) 是一个面部规范,如下所述: http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Faces.html

简而言之,它是 (display .plist) 形式的列表,因此在代码中 t 对应于 display(:background... )plistplist 是人脸属性的属性列表,与问题无关,我就不多说了。但是,display 可以采用 t 之外的其他值。上述文档将 display 描述为:

The display part of an element of spec determines which terminals the element matches.

t表示:

This element of spec matches all terminals.

但是,您可以更有选择性,并将面部属性定义为仅适用于某些终端,例如仅适用于支持颜色的终端。

关于emacs - Emacs主题定义中,为什么会有(t ( :background "black")),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30826154/

相关文章:

emacs - 在这种情况下如何使用 (interactive "r") 功能?

emacs - 我怎么能在输入内容时使用像 isearch-forward 这样的查询替换

emacs - 如何重构 Clojure 源代码?

linux - 我在哪里? (地理位置,Emacs和Perl)

vim - 为什么您更喜欢 spacemacs 而不是在 'evil' 模式下运行的 emacs?

emacs - 在 Elisp 中调试 "Error setting nil"

unicode - 如何在 elisp 中获取字符的代码点(以及其他方式)?

emacs - 在 Emacs 中模拟迷你缓冲区输入

emacs - Elisp中绝对路径的相对路径

emacs - 如何在主要模式发生变化之前运行函数