Skip to content

Commit 413310c

Browse files
committed
Define box line-width more carefully
Before Emacs 28, the value had to be a number. In Emacs 30 it can be a cons-cell of two numbers, but the manual says that it can still be a number. But that doesn't seem to work for all Emacs releases in between, at least not when using a negative number. Try to cater to the preferences of various Emacs releases.
1 parent e02dfa6 commit 413310c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lisp/transient.el

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ See info node `(transient)Enabling and Disabling Suffixes'."
498498
:group 'transient-faces)
499499

500500
(defface transient-higher-level
501-
`((t (:box ( :line-width -1
501+
`((t (:box ( :line-width ,(if (>= emacs-major-version 28) (cons -1 -1) -1)
502502
:color ,(face-attribute 'shadow :foreground nil t)))))
503503
"Face optionally used to highlight suffixes on higher levels.
504504
Also see option `transient-highlight-higher-levels'."
@@ -560,13 +560,15 @@ character used to separate possible values from each other."
560560
:group 'transient-faces)
561561

562562
(defface transient-nonstandard-key
563-
'((t (:box (:line-width -1 :color "cyan"))))
563+
`((t (:box ( :line-width ,(if (>= emacs-major-version 28) (cons -1 -1) -1)
564+
:color "cyan"))))
564565
"Face optionally used to highlight keys conflicting with short-argument.
565566
Also see option `transient-highlight-mismatched-keys'."
566567
:group 'transient-faces)
567568

568569
(defface transient-mismatched-key
569-
'((t (:box (:line-width -1 :color "magenta"))))
570+
`((t (:box ( :line-width ,(if (>= emacs-major-version 28) (cons -1 -1) -1)
571+
:color "magenta"))))
570572
"Face optionally used to highlight keys without a short-argument.
571573
Also see option `transient-highlight-mismatched-keys'."
572574
:group 'transient-faces)

0 commit comments

Comments
 (0)