mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-02-07 20:54:32 +00:00
Reduce face-related consing during frame creation.
* faces.el (face--attributes-unspecified): Compute the "unspecified" attribute list once. (face-spec-reset-face): Use it instead of building the list.
This commit is contained in:
parent
85c12310ff
commit
9fa9c26e42
@ -1598,6 +1598,13 @@ is given, in which case return its value instead."
|
||||
result
|
||||
no-match-retval))))
|
||||
|
||||
;; When over 80 faces get processed at frame creation time, all but
|
||||
;; one specifying all attributes as "unspecified", generating this
|
||||
;; list every time means a lot of consing.
|
||||
(defconst face--attributes-unspecified
|
||||
(apply 'append
|
||||
(mapcar (lambda (x) (list (car x) 'unspecified))
|
||||
face-attribute-name-alist)))
|
||||
|
||||
(defun face-spec-reset-face (face &optional frame)
|
||||
"Reset all attributes of FACE on FRAME to unspecified."
|
||||
@ -1622,9 +1629,7 @@ is given, in which case return its value instead."
|
||||
"unspecified-fg"
|
||||
"unspecified-bg")))))
|
||||
;; For all other faces, unspecify all attributes.
|
||||
(apply 'append
|
||||
(mapcar (lambda (x) (list (car x) 'unspecified))
|
||||
face-attribute-name-alist)))))
|
||||
face--attributes-unspecified)))
|
||||
|
||||
(defun face-spec-set (face spec &optional spec-type)
|
||||
"Set the face spec SPEC for FACE.
|
||||
|
Loading…
x
Reference in New Issue
Block a user