Warn about :reverse-video in defface

This attribute keyword has been non-working in defface for 14 years,
thus warning about it is both safe and decent.

* lisp/emacs-lisp/bytecomp.el (bytecomp--check-cus-face-spec):
Warn and suggest :inverse-video to be used instead.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defface-spec):
Add a test case.
* etc/NEWS: Notify the user.
This commit is contained in:
Mattias Engdegård 2024-09-28 22:04:19 +02:00
parent dfdeee839a
commit 8d0c8076c3
3 changed files with 13 additions and 2 deletions

View file

@ -5396,15 +5396,18 @@ FORM is used to provide location, `bytecomp--cus-function' and
:underline :overline :strike-through :box
:inverse-video :stipple :font
;; FIXME: obsolete keywords, warn about them too?
;; `:reverse-video' is very rare.
:bold ; :bold t = :weight bold
:italic ; :italic t = :slant italic
:reverse-video ; alias for :inverse-video
))
(when (eq (car-safe val) 'quote)
(bytecomp--cus-warn
(list val atts sp spec)
"Value for face attribute `%s' should not be quoted" attr)))
((eq attr :reverse-video)
(bytecomp--cus-warn
(list atts sp spec)
(concat "Face attribute `:reverse-video' is obsolete;"
" use `:inverse-video' instead")))
(t
(bytecomp--cus-warn
(list atts sp spec)