1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00

Consider face inheritance when checking region face background.

Some themes (like dracula) make the region face inherit from some
other face.  If the background color of the region was inherited,
`indicate-copied-region' did the switch-point-and-mark-twice dance
which is not visible in case the region is highlighted.  It just
looked like Emacs would hang for a second after M-w.

* lisp/simple.el (indicate-copied-region): Consider face inheritance
when checking region face background.
This commit is contained in:
Tassilo Horn 2020-05-15 22:24:29 +02:00
parent e75f6be6cc
commit 28541674cd

View File

@ -4852,7 +4852,7 @@ of this sample text; it defaults to 40."
;; Swap point-and-mark quickly so as to show the region that
;; was selected. Don't do it if the region is highlighted.
(unless (and (region-active-p)
(face-background 'region))
(face-background 'region nil t))
;; Swap point and mark.
(set-marker (mark-marker) (point) (current-buffer))
(goto-char mark)