diff options
| author | Eli Zaretskii | 2019-03-04 18:28:18 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-03-04 18:28:18 +0200 |
| commit | 6a1dcf594a8b6aa72820f04b529aa3454cf3fc61 (patch) | |
| tree | b4cd31e22d6846f33a4b20ed89063e2e887c1438 | |
| parent | 4aa74ddd1b332bafbb0c9272086170647b87cb84 (diff) | |
| download | emacs-6a1dcf594a8b6aa72820f04b529aa3454cf3fc61.tar.gz emacs-6a1dcf594a8b6aa72820f04b529aa3454cf3fc61.zip | |
Fix invocation with -rv on the command line
* lisp/frame.el (frame-set-background-mode): Avoid errors from
'face-spec-match-p' when the face was not yet realized for
FRAME. (Bug#34725)
| -rw-r--r-- | lisp/frame.el | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lisp/frame.el b/lisp/frame.el index 8a4a0b6639b..7fe3282eb59 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -1119,9 +1119,23 @@ face specs for the new background mode." | |||
| 1119 | ;; most faces are unmodified). | 1119 | ;; most faces are unmodified). |
| 1120 | (dolist (face (face-list)) | 1120 | (dolist (face (face-list)) |
| 1121 | (and (not (get face 'face-override-spec)) | 1121 | (and (not (get face 'face-override-spec)) |
| 1122 | (not (face-spec-match-p face | 1122 | (not (and |
| 1123 | (face-user-default-spec face) | 1123 | ;; If the face was not yet realized for the |
| 1124 | (selected-frame))) | 1124 | ;; frame, face-spec-match-p will signal an |
| 1125 | ;; error, so treat such a missing face as | ||
| 1126 | ;; having a mismatched spec; the call to | ||
| 1127 | ;; face-spec-recalc below will then realize | ||
| 1128 | ;; the face for the frame. This happens | ||
| 1129 | ;; during startup with -rv on the command | ||
| 1130 | ;; line for the initial frame, because frames | ||
| 1131 | ;; are not recorded in the pdump file. | ||
| 1132 | (assq face (frame-face-alist)) | ||
| 1133 | (face-spec-match-p face | ||
| 1134 | (face-user-default-spec face) | ||
| 1135 | ;; FIXME: why selected-frame and | ||
| 1136 | ;; not the frame that is the | ||
| 1137 | ;; argument to this function? | ||
| 1138 | (selected-frame)))) | ||
| 1125 | (push face locally-modified-faces))) | 1139 | (push face locally-modified-faces))) |
| 1126 | ;; Now change to the new frame parameters | 1140 | ;; Now change to the new frame parameters |
| 1127 | (modify-frame-parameters frame params) | 1141 | (modify-frame-parameters frame params) |