bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60841: 30.0.50; kill-ring-save pauses despite region being highlight


From: Gregory Heytings
Subject: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted
Date: Tue, 17 Jan 2023 08:26:53 +0000


But it would be better to have there a test which would tell us whether the region face is "visually different" from the default face. Can we do something like that?

face-differs-from-default-p?

Nice catch; IIUC display-supports-face-attributes-p is what is doing the heavy work.

Might need to be made smarter wrt :extend though?


Indeed...


(set-face-background 'region (face-background 'default nil t))
(face-differs-from-default-p 'region nil)
; ⇒ :extend


... although that's a really contrived example.

I'm not sure it's TRT to add too much complexity there, so I would suggest to add an additional optional argument to face-differs-from-default-p, to exclude one or more attributes from the comparison (in this case :extend, but someone else might be interested in excluding other attributes in the future).
reply via email to

[Prev in Thread] Current Thread [Next in Thread]