为了.3
从使用 2 秒空闲计时器(自定义函数梳理缓冲区)设置的自定义函数的运行时间缩短大约几秒钟,我使用(font-lock-mode -1)
. 副作用是我的flyspell-incorrect
并被flyspell-duplicate
删除。将那些 flyspell 字体重新放回原处的(flyspell-region (window-start) (window-end))
成本远远超过 .3
几秒钟。因此,我正在考虑通过删除除 flyspell-incorrect
and之外的所有字体锁定字体来实现中间立场flyspell-duplicate
。有没有办法向以下代码片段添加条件,以font-core
保留 flyspell 字体,但删除其他所有内容?
;; Turn off Font Lock mode.
(unless mode
;; Remove `font-lock-face' as an alias for the `face' property.
(set (make-local-variable 'char-property-alias-alist)
(copy-tree char-property-alias-alist))
(let ((elt (assq 'face char-property-alias-alist)))
(when elt
(setcdr elt (remq 'font-lock-face (cdr elt)))
(when (null (cdr elt))
(setq char-property-alias-alist
(delq elt char-property-alias-alist))))))