From 4ea0f4d8128951432169b1e6db3dd4ac42492e93 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 24 Mar 2021 11:47:48 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=98org-code=E2=80=99=20face=20for?= =?UTF-8?q?=20Emacs=2027=20and=20before?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- yoshi-theme.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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))))