fix: blank frame on can't-find-font error during startup
Due to our inhibit-redisplay hack, a missing font could lead to a blank Emacs after startup. This change fixes that so that not only is an error emitted when Emacs can't find your font, but the error will be a little more readable. This is a stopgap solution until I finish a better one I'm preparing for v3. Fix: #7055
This commit is contained in:
parent
7a3773484b
commit
98d753e103
1 changed files with 18 additions and 12 deletions
|
@ -524,18 +524,24 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||||
(fixed-pitch . ,doom-font)
|
(fixed-pitch . ,doom-font)
|
||||||
(fixed-pitch-serif . ,doom-serif-font)
|
(fixed-pitch-serif . ,doom-serif-font)
|
||||||
(variable-pitch . ,doom-variable-pitch-font)))
|
(variable-pitch . ,doom-variable-pitch-font)))
|
||||||
(when-let* ((face (car map))
|
(condition-case e
|
||||||
(font (cdr map)))
|
(when-let* ((face (car map))
|
||||||
(dolist (frame (frame-list))
|
(font (cdr map)))
|
||||||
(when (display-multi-font-p frame)
|
(dolist (frame (frame-list))
|
||||||
(set-face-attribute face frame
|
(when (display-multi-font-p frame)
|
||||||
:width 'normal :weight 'normal
|
(set-face-attribute face frame
|
||||||
:slant 'normal :font font)))
|
:width 'normal :weight 'normal
|
||||||
(let ((new-specs (doom--make-font-specs face font)))
|
:slant 'normal :font font)))
|
||||||
;; Don't save to `customized-face' so it's omitted from `custom-file'
|
(let ((new-specs (doom--make-font-specs face font)))
|
||||||
;;(put face 'customized-face new-specs)
|
;; Don't save to `customized-face' so it's omitted from `custom-file'
|
||||||
(custom-push-theme 'theme-face face 'user 'set new-specs)
|
;;(put face 'customized-face new-specs)
|
||||||
(put face 'face-modified nil))))
|
(custom-push-theme 'theme-face face 'user 'set new-specs)
|
||||||
|
(put face 'face-modified nil)))
|
||||||
|
('error
|
||||||
|
(ignore-errors (doom--reset-inhibited-vars-h))
|
||||||
|
(if (string-prefix-p "Font not available" (error-message-string e))
|
||||||
|
(signal 'doom-font-error (list (font-get (cdr map) :family)))
|
||||||
|
(signal (car e) (cdr e))))))
|
||||||
(when (fboundp 'set-fontset-font)
|
(when (fboundp 'set-fontset-font)
|
||||||
(let* ((fn (doom-rpartial #'member (font-family-list)))
|
(let* ((fn (doom-rpartial #'member (font-family-list)))
|
||||||
(symbol-font (or doom-symbol-font
|
(symbol-font (or doom-symbol-font
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue