【发布时间】:2019-09-18 07:04:53
【问题描述】:
我正在寻求一些帮助,以控制 粗体 面与叠加。使用标准的font-lock 方法,通常将:bold nil 放在另一面就足够了,以防止它被压倒。但是,在处理叠加层时,同样的概念似乎并不适用。在处理叠加层时,还有什么办法可以防止 bold 渗入其他面?
例如:当两个叠加层重叠时,如何防止tab-face bold 胜过hr-underscore-face?
(defface tab-face
'((t (:foreground "cyan" :bold t)))
"Face for `tab-face`."
:group 'lawlist-ruler-faces)
(defface hr-underscore-face
'((t (:underline "yellow" :bold nil)))
"Face for `hr-underscore-face`."
:group 'lawlist-ruler-faces)
编辑(2014 年 6 月 19 日):添加了示例 .emacs 配置以重现问题,以及两个屏幕截图。 ispell-program-name 的路径需要根据用户自己的设置来设置。
;; GNU Emacs 24.4.50.1 (x86_64-apple-darwin10.8.0,
;; NS appkit-1038.36 Version 10.6.8 (Build 10K549)) of 2014-06-01 on MP.local
(set-face-attribute 'default nil
:background "black" :foreground "white" :font "Courier" :height 180)
(tool-bar-mode -1)
(require 'ispell)
(require 'flyspell)
(setq-default ispell-program-name
"/Users/HOME/.0.data/.0.emacs/elpa/bin/aspell")
(custom-set-faces
'(flyspell-incorrect ((t (:foreground "yellow" :weight bold ))))
'(highlight ((t (:underline "yellow" :weight normal)))))
(defun zoom ()
(interactive)
(setq buffer-face-mode-face `(:height 575))
(buffer-face-mode 1))
(defun test-number-one ()
(interactive)
(switch-to-buffer (get-buffer-create "test-number-ONE"))
(zoom)
(turn-on-flyspell)
(setq flyspell-mark-duplications-flag nil)
(setq flyspell-duplicate-distance 0)
(hl-line-mode 1)
(insert
"This is `test-number-one`."
"\n"
"\n"
"Aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz"
"\n"
"\n"
"Aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz"))
(defun test-number-two ()
(interactive)
(switch-to-buffer (get-buffer-create "test-number-TWO"))
(zoom)
(hl-line-mode 1)
(insert
"This is `test-number-two`."
"\n"
"\n"
"Aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz"
"\n"
"\n"
"Aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz"))
在第一个示例中,下划线是粗体。 [但是,我想学习如何使下划线始终具有正常的粗细(即使文本的:foreground 是粗体)。]
(来源:lawlist.com)
在第二个例子中,下划线是正常。
(来源:lawlist.com)
【问题讨论】: