1
0
Fork 0
mirror of https://git.sr.ht/~ryuslash/yoshi-theme synced 2025-01-31 03:15:52 +01:00

Fix ‘org-code’ face for Emacs 27 and before

Emacs 28 has introduced the option to specify the horizontal and vertical widths
for ‘:box’ face specifications. This fails on earlier versions of Emacs however,
so check the major version to see what to do.
This commit is contained in:
Tom Willemse 2021-03-24 11:47:48 -07:00
parent eb2a38c71a
commit 4ea0f4d812

View file

@ -39,6 +39,13 @@
(advice-add 'propertized-buffer-identification
:filter-args #'yoshi-theme-add-space-to-first-arg)
(defun yoshi-theme--make-inline-box (border-color)
"Return a list representing a box specification using BORDER-COLOR."
(let ((line-width (if (> emacs-major-version 27)
'(5 . -1)
5)))
`(:line-width ,line-width :color ,border-color)))
(let ((yoshi-0 "#111414")
(yoshi-1 "#2c3434")
(yoshi-2 "#475454")
@ -409,7 +416,7 @@
`(org-block-end-line ((t (:foreground ,yoshi-4 :slant unspecified :background ,yoshi-1 :height 0.71))))
`(org-checkbox-statistics-done ((t (:foreground ,bgcyan))))
`(org-checkbox-statistics-todo ((t (:foreground ,fgcyan))))
`(org-code ((t (:background ,yoshi-1 :box (:line-width (5 . -1) :color ,yoshi-1) :inherit fixed-pitch))))
`(org-code ((t (:background ,yoshi-1 :box ,(yoshi-theme--make-inline-box yoshi-1) :inherit fixed-pitch))))
`(org-date ((t (:foreground ,fgpink :underline unspecified))))
`(org-document-info-keyword ((t (:foreground ,yoshi-4 :inherit fixed-pitch))))
`(org-document-title ((t (:foreground ,fgorange :height 1.5))))