diff options
| author | 2021-03-24 11:47:48 -0700 | |
|---|---|---|
| committer | 2021-03-24 11:47:48 -0700 | |
| commit | 4ea0f4d8128951432169b1e6db3dd4ac42492e93 (patch) | |
| tree | 174372b6270924449af991680e7e9b5d4dbba697 | |
| parent | eb2a38c71a955fa934ac7a907b9924b3755e40c7 (diff) | |
| download | yoshi-theme-4ea0f4d8128951432169b1e6db3dd4ac42492e93.tar.gz yoshi-theme-4ea0f4d8128951432169b1e6db3dd4ac42492e93.zip | |
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.
| -rw-r--r-- | yoshi-theme.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/yoshi-theme.el b/yoshi-theme.el index 85a0331..01024a9 100644 --- a/yoshi-theme.el +++ b/yoshi-theme.el @@ -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)))) |
