Skip to content

Commit

Permalink
Check if a face does not exists before setting it.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnngimenez committed Apr 2, 2023
1 parent 086bbe7 commit 32bf4d9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions nano-theme.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ Defaults to nil."
;; When we set a face, we take care of removing any previous settings
(defun set-face (face style)
"Reset FACE and make it inherit STYLE."
(set-face-attribute face nil
:foreground 'unspecified :background 'unspecified
:family 'unspecified :slant 'unspecified
:weight 'unspecified :height 'unspecified
:underline 'unspecified :overline 'unspecified
:box 'unspecified :inherit style))
(if (facep face)
(set-face-attribute face nil
:foreground 'unspecified :background 'unspecified
:family 'unspecified :slant 'unspecified
:weight 'unspecified :height 'unspecified
:underline 'unspecified :overline 'unspecified
:box 'unspecified :inherit style)
(message "NANO Warning: Face %s could not be set. It may not be defined."
face)))



(defun nano-theme--basics ()
Expand Down

0 comments on commit 32bf4d9

Please sign in to comment.