GNU bug report logs - #73552
obsolete (and broken) face attribute :reverse-video

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Date: Sun, 29 Sep 2024 10:51:02 UTC

Severity: normal

Done: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>
Subject: bug#73552: closed (Re: bug#73552: obsolete (and broken) face
 attribute :reverse-video)
Date: Sun, 29 Sep 2024 16:25:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#73552: obsolete (and broken) face attribute :reverse-video

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 73552 <at> debbugs.gnu.org.

-- 
73552: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73552
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 73552-done <at> debbugs.gnu.org
Subject: Re: bug#73552: obsolete (and broken) face attribute :reverse-video
Date: Sun, 29 Sep 2024 18:22:42 +0200
29 sep. 2024 kl. 15.49 skrev Eli Zaretskii <eliz <at> gnu.org>:

> I think the use of :reverse-video in make-mode.el should be changed to
> :inverse-video.

Oh, certainly (compiling that file now yields a warning).

The few extant uses of :reverse-video discovered so far seem to be fall-back cases for non-colour displays, decidedly a rarity these days.

>  Otherwise, I'm okay with retiring this old and
> half-supported alias.

Thank you, now done.


29 sep. 2024 kl. 15.55 skrev Stefan Kangas <stefankangas <at> gmail.com>:

> We could start by doing s/:bold t/:weight bold/ and
> s/:italic t/:slant italic/ in our tree.

Yes, maybe later. At least these still work, and are widely used by external packages.

> I'd propose adding obsoletion warnings for :bold and :italic.  I note
> that they are not documented in the elisp manual.

Wr probably should but the compilation warnings only catch constant arguments to `defface`. Other uses (themes, font-lock, computed text properties, non-constant arguments to defface, etc) aren't caught; that would require a run-time warning.

Anyway, we're done with :reverse-video, thanks everyone!


[Message part 3 (message/rfc822, inline)]
From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Emacs Bug Report <bug-gnu-emacs <at> gnu.org>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: obsolete (and broken) face attribute :reverse-video
Date: Sun, 29 Sep 2024 12:49:44 +0200
The face attribute keyword :reverse-video has been broken in defface for a long time, and it's not used very much, so I added a compiler warning and a notice to NEWS.

This keyword along with :bold and :italic have been obsolete for longer than that and aren't even mentioned in any documentation (on purpose) but in the internal face-and-display machinery they still partly work.

I'm not quite sure why :reverse-video doesn't work in defface. Demo, in *scratch*:

  (defface myface '((t :reverse-video t)) "my face")

  (insert (propertize "bon bon" 'font-lock-face 'myface) ?\n)
  => bon bon  ; not inverted

  (insert (propertize "non non" 'font-lock-face '(:reverse-video t)) ?\n)
  => non non  ; inverted

I first blamed a simple 14 years old mistake in `custom-fix-face-spec` but fixing that doesn't help, not sure why. But it means that we probably don't need to fix it, and indeed there are precious few packages using :reverse-video. One is make-mode.el; outside Emacs, I only found one (yaml-mode).

While :bold and :italic are obsolete as well, they are used a lot more (and actually seem to work) so I'm not warning about them now.

To summarise:
- Should we fix `custom-fix-face-spec`? Maybe, or just stop pretending that it handles :reverse-video.
- Should we bother to fix what other mechanism preventing :reverse-video from working? Probably no.
- Should we remove :reverse-video from the display machinery? Yes, but maybe not now?
- Should we remove :bold and :italic? Yes, but definitely not now.




This bug report was last modified 235 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.