Skip to content

Commit

Permalink
Define box line-width more carefully
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tarsius committed Dec 3, 2023
1 parent e02dfa6 commit 413310c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ See info node `(transient)Enabling and Disabling Suffixes'."
:group 'transient-faces)

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

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

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

0 comments on commit 413310c

Please sign in to comment.