summaryrefslogtreecommitdiff
path: root/src/xfaces.c
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2023-01-29 11:23:01 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2023-02-02 19:39:39 +0100
commitc4988840598b7da84b25d21a1936ce1ab6f6d666 (patch)
tree0899a6fd53ebd903540b5f2e57f02a2d0b565ac4 /src/xfaces.c
parent382ab516cefc974d65622479fb7e844fd982011d (diff)
downloademacs-c4988840598b7da84b25d21a1936ce1ab6f6d666.tar.gz
Avoid spurious pause in kill-ring-save (Bug#60841)
'indicate-copied-region' checks whether the region is "highlighted" and if not, briefly moves point to mark to give a visual cue of the extent of text that was saved to the kill ring. The region is considered "highlighted" if (a) it is active and (b) its face specifies a :background. That latter condition does not account for the multiple ways in which the face can make the region "visually distinct" from the default face, so switch to the more extensive predicate face-differs-from-default-p. The patch also fixes a couple of issues with the predicate's implementation, and introduces a new user option in case anyone happened to enjoy unconditional blinking. * lisp/faces.el (face-differs-from-default-p): Filter out :extend; add rationale for the attributes we ignore. * lisp/simple.el (copy-region-blink-predicate): Add option to let users explicitly opt into or out of blinking point and mark. (region-indistinguishable-p): New function to detect "if there is currently no active region highlighting", leveraging face-differs-from-default-p. (indicate-copied-region): Use it. * src/xfaces.c (merge_face_ref): Allow :stipple to be nil, since it is a documented valid value for that attribute. * etc/NEWS: Announce user option.
Diffstat (limited to 'src/xfaces.c')
-rw-r--r--src/xfaces.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index 35b79154805..62d7823f308 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -2780,8 +2780,7 @@ merge_face_ref (struct window *w,
else if (EQ (keyword, QCstipple))
{
#if defined (HAVE_WINDOW_SYSTEM)
- Lisp_Object pixmap_p = Fbitmap_spec_p (value);
- if (!NILP (pixmap_p))
+ if (NILP (value) || !NILP (Fbitmap_spec_p (value)))
to[LFACE_STIPPLE_INDEX] = value;
else
err = true;