GNU bug report logs - #80905
30.2.50; Face-remapping not respected by cursor

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "J.D. Smith" <jdtsmith@HIDDEN>; dated Sun, 26 Apr 2026 00:14:03 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 80905 <at> debbugs.gnu.org:


Received: (at 80905) by debbugs.gnu.org; 26 Apr 2026 06:25:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 26 02:25:17 2026
Received: from localhost ([127.0.0.1]:50173 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wGsvb-0003QQ-BJ
	for submit <at> debbugs.gnu.org; Sun, 26 Apr 2026 02:25:17 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59212)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1wGsvX-0003Oe-W7
 for 80905 <at> debbugs.gnu.org; Sun, 26 Apr 2026 02:25:14 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1wGsvR-0002pi-3r; Sun, 26 Apr 2026 02:25:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=/NZAO3CBNoBZU3vhylU8UwD3eiYaBhN78K38fpKCK98=; b=IuFSYeMVAxlv
 oYIjl00ozp0qhBvzbV2OBtsNLnNutzRxNDB2FshloQADAztf9LHut5ohmNgdOUsPDokv98DsyvhpB
 Q1tMVGOOFhYHh8qdFcJ7Cf13j5+mrlv4RpeBqzImzTTiZlW905BnMnFzW1buNM3ujOYPrlkMfSjWZ
 50ISiw5wJUbwJmR+9omYME9Od27ZKCqL2TpjU4GRzoGXifTbXk8i8wYV3QlQ8LqQcHO6sIJV5NdQD
 UjK8QASkdqVo/9PZXFFJso6/Xtzgbkiv+rHLEM1dFX5CXJtT9/Tk3m750ImTplahrkGVIYHb9DuUr
 l3aBd8EkTF/DIn1w/qzQhA==;
Date: Sun, 26 Apr 2026 09:25:01 +0300
Message-Id: <86eck28chu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: "J.D. Smith" <jdtsmith@HIDDEN>
In-Reply-To: <m24ikyinou.fsf@HIDDEN> (jdtsmith@HIDDEN)
Subject: Re: bug#80905: 30.2.50; Face-remapping not respected by cursor
References: <m24ikyinou.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 80905
Cc: 80905 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: "J.D. Smith" <jdtsmith@HIDDEN>
> Date: Sat, 25 Apr 2026 20:13:05 -0400
> 
> 
> I've noticed that face-remapping does not apparently work for the
> 'cursor face.  E.g. try:
> 
>      (face-remap-add-relative 'cursor 'secondary-selection)
> 
> The cursor is unchanged.  This is unfortunate because this is the only
> way to set the cursor color distinctly in an individual buffer
> (optionally filtered to certain windows).

Face-remapping is not magic, it must be explicitly coded in C,
whenever a face is used for display.

In this case, it is even more complicated than just adding the code to
remap the face.  That's because the 'cursor' face is not handled in
Emacs as other basic faces.  Instead, the background of the 'cursor'
face is used to set the frame parameter 'cursor-color' (and we have a
separate variable 'x-cursor-fore-pixel' to optionally control the
foreground of the cursor); the other face attributes are simply
ignored, AFAIU.  When the background-color attribute of the 'cursor'
face changes, we change the 'cursor-color' frame parameter.  Whenever
the 'cursor-color' value changes, it is recorded in a special graphic
context (GC) of the frame, and thereafter used whenever we need to
draw the cursor.  This cannot support buffer-local face remapping for
obvious reasons.

So to make the 'cursor' face remappable, we need fundamental changes
in how it is used, so that each time a window's cursor is displayed,
we go through the "normal channels" of face realization and use to
display the cursor glyph, like we do with buffer text etc.  Patches
welcome.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#80905; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Apr 2026 00:13:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 25 20:13:19 2026
Received: from localhost ([127.0.0.1]:46203 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wGn7e-0006cS-SZ
	for submit <at> debbugs.gnu.org; Sat, 25 Apr 2026 20:13:19 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:34956)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <jdtsmith@HIDDEN>)
 id 1wGn7c-0006bq-St
 for submit <at> debbugs.gnu.org; Sat, 25 Apr 2026 20:13:17 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jdtsmith@HIDDEN>)
 id 1wGn7W-0002gW-T8
 for bug-gnu-emacs@HIDDEN; Sat, 25 Apr 2026 20:13:10 -0400
Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jdtsmith@HIDDEN>)
 id 1wGn7V-0003w2-AE
 for bug-gnu-emacs@HIDDEN; Sat, 25 Apr 2026 20:13:10 -0400
Received: by mail-qt1-x82e.google.com with SMTP id
 d75a77b69052e-506362ac5f7so75441161cf.1
 for <bug-gnu-emacs@HIDDEN>; Sat, 25 Apr 2026 17:13:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20251104; t=1777162387; x=1777767187; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=etk4fFyYxtWgkwIyO5t44LhCm7WfFFUU1UZUk+AWOYA=;
 b=oiOCDHb8/9DwNd11Mre9yiHV0nBWpRulxlcw51n1Jn0vRfwPUKvv5b+Lw6/dIj4Vp8
 20uHZ0s+rBsrPVr2WmmvnkUBPlfLs+g2ynrwtR961cTQB2fwY3+0bvXH1FP9LI0DQCeV
 aU2Z4xMk1gmL6D7Ic6k/FZBmWq7lOvT5QmArFbfLUp+MyZpbOWVbb/jAv4z0TRVuxTlK
 00VPQvDbQDm9IUhqd5iWiwL/eu+QISYcITCMr1lUc91lhzlE42hyXLF0oVbU+L3nkMK/
 YtgcLSrZ7rUtsHW1eJiBM+Ihi+Ree3Hdn7uazhq68/dc7AmFQCo9/KckaWWylxb2+26V
 qyug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1777162387; x=1777767187;
 h=mime-version:message-id:date:subject:to:from:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=etk4fFyYxtWgkwIyO5t44LhCm7WfFFUU1UZUk+AWOYA=;
 b=V6AtijSnrUXVuZB1lRf0sj5kkJbqRfoUvxtmCV4xaFd/0YVau6OoP7IdZ1jWnmoZbY
 3iKdawkcTFtdpyNTa98jnCnJJhJNwoj60xoWUna0sZ98GJKv65DBz9TX6JHuPloCk1A0
 ivO+nC9zH8HKSIortJbCla9A68QYKrTVk3WMFMeEWzk7Udbnl5LYkJ7n2OAISN1rrAw3
 ZZZkArvwOW0aymmbrI6qnKlNTSX9vaF3hASKKA8jucH5gNEJrIx5BAoeLkupkZSyFGnd
 X7v7yVeVwsHMGqW15kQBC34tPb5QNuLz3FjcL0dUIr2MIer/JiWNL5nBRrb20YmLyYLI
 fptg==
X-Gm-Message-State: AOJu0YwyAtiOZYHwcGaABRIVkTKqE4GSPt70veJey1I+l3OylZ0i5OnC
 E0J55Xolb8BkLQJZ6EiNW0EJV1dLcl7M7/pXaglgRLlr8AcO/LT7AzA5BYf95A==
X-Gm-Gg: AeBDieua/vsC/hnhONSDM9eIWiZ2+6M+nlYcmbGmbo0Urr1El8qFXrLDNbTPUC0k/i8
 Fl7lrtKUnZCjvL8g9tasRjDSonQCB3tQA8XRD8mwJY7f02rgM1j23+VGll1q5GwVY9uJlU9HFdg
 +s2H7irGcHed4lun+tZD+btf8o8cZbNUzu7Ni5kSzIwp9jCmfYqtCTsYlThO0VZyWEorSttUvss
 c3s5VNEiXlAriunuH7CvejJXJiruYQtMeVEdkHLHiyh7ALkRgmZGq6OE5/jI1MyrDVnGB+AvBJE
 2avfyKO6QwkS9NWADBGEbTIlUQCJlwKw3xezSWeWaHS+nbSikj9T66ADQ8/h8+1THDe2mmJ7Plm
 aVFZBF/AsZklJ1+dPt1Ad/XSltUTnyQXiws42fgxNWKw8i1TmNudObqAml0s4XjKGWxlbuGpi39
 /ElM8fADxtnuRKMkCmTzme1wRpIgVfIxploQZ9kIRVKwcQUSjd+LFMclIhFg8hrT9uigNY
X-Received: by 2002:ac8:5889:0:b0:50f:135d:9508 with SMTP id
 d75a77b69052e-50f135d9812mr387180291cf.55.1777162387464; 
 Sat, 25 Apr 2026 17:13:07 -0700 (PDT)
Received: from moss-10 (cm-24-53-187-185.buckeyecom.net. [24.53.187.185])
 by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-50e40aab60dsm213052251cf.18.2026.04.25.17.13.06
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 25 Apr 2026 17:13:06 -0700 (PDT)
From: "J.D. Smith" <jdtsmith@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.2.50; Face-remapping not respected by cursor
X-Debbugs-Cc: 
Date: Sat, 25 Apr 2026 20:13:05 -0400
Message-ID: <m24ikyinou.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2607:f8b0:4864:20::82e;
 envelope-from=jdtsmith@HIDDEN; helo=mail-qt1-x82e.google.com
X-Spam_score_int: -10
X-Spam_score: -1.1
X-Spam_bar: -
X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FORGED_GMAIL_RCVD=1,
 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  I've noticed that face-remapping does not apparently work
 for the 'cursor face. E.g. try: (face-remap-add-relative 'cursor
 'secondary-selection)
 The cursor is unchanged. This is unfortunate because this is the only way
 to set the cursor color distinctly in an individual buffer (optionally
 filtered to certain windows). 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (jdtsmith[at]gmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
 headers
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)


I've noticed that face-remapping does not apparently work for the
'cursor face.  E.g. try:

     (face-remap-add-relative 'cursor 'secondary-selection)

The cursor is unchanged.  This is unfortunate because this is the only
way to set the cursor color distinctly in an individual buffer
(optionally filtered to certain windows).




Acknowledgement sent to "J.D. Smith" <jdtsmith@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#80905; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 26 Apr 2026 06:30:02 UTC

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