【问题标题】:Emacs font-lock highlighting weirdnessEmacs 字体锁定突出怪异
【发布时间】:2012-12-12 15:28:19
【问题描述】:

我有更改默认颜色主题的代码。我更喜欢这种方式,因为我添加了更多类然后默认font-lock

(defmacro /construct-face (name comment &rest args)
    "Define face and specify attributes."
    (list 'progn
          (list 'defface name nil comment)
          (nconc (list 'set-face-attribute (list 'quote name) nil) args)))

(/construct-face ⋅function-name "Face to highlight functions."
                  :foreground "SlateBlue")
(setq font-lock-function-name-face '⋅function-name)
(/construct-face ⋅comment "Face to display comments"
                  :foreground "gray20"
                  :bold t)
(setq font-lock-comment-face '⋅comment)

奇怪的是注释颜色变成了灰色,但函数的名称没有变成紫色。有什么区别,我应该尝试检查什么?

【问题讨论】:

  • 你在这里做了一些奇怪的事情。为什么不在 Emacs 24 中使用内置主题?

标签: emacs elisp font-lock


【解决方案1】:

因为不是“gray20”而是"grey20",所以我昨天也犯了这个错误,但是是grey10。

【讨论】:

  • 我的错。对我来说这也令人困惑,使用 / 和一些奇怪的字符 ' 评论......这是什么?
  • Lisp 的本质就是符号。我使用一些关于符号命名的约定来简化突出显示。我已经找到了copy-face 的解决方案,但它似乎是肮脏的黑客攻击。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多