From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43396: 27.1; Customized "cursor" face has no effect in daemon mode Date: Tue, 29 Jun 2021 15:21:45 +0300 Message-ID: <83k0mcoo86.fsf@gnu.org> References: <875z8g331g.fsf@iki.fi> <83o8m89xv8.fsf@gnu.org> <87zgvv6znf.fsf@gnus.org> <83eed78d1z.fsf@gnu.org> <83tum26vuv.fsf@gnu.org> <87pmw68fmt.fsf@iki.fi> <83eecmp5l2.fsf@gnu.org> <8735t2qhi3.fsf@iki.fi> <835yxyoxa5.fsf@gnu.org> <87bl7plxz2.fsf@iki.fi> <83y2atoqbc.fsf@gnu.org> <878s2tltc3.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12374"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43396@debbugs.gnu.org, larsi@gnus.org To: Teemu Likonen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 29 14:22:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyCkm-00034D-NS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Jun 2021 14:22:12 +0200 Original-Received: from localhost ([::1]:59930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyCkl-00083U-M4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Jun 2021 08:22:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyCkd-00083M-4N for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 08:22:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyCkc-0004rd-RZ for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 08:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lyCkc-0003jc-IB for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 08:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Jun 2021 12:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43396 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 43396-submit@debbugs.gnu.org id=B43396.162496931514340 (code B ref 43396); Tue, 29 Jun 2021 12:22:02 +0000 Original-Received: (at 43396) by debbugs.gnu.org; 29 Jun 2021 12:21:55 +0000 Original-Received: from localhost ([127.0.0.1]:53808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyCkU-0003jE-Pf for submit@debbugs.gnu.org; Tue, 29 Jun 2021 08:21:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyCkS-0003j0-5Q for 43396@debbugs.gnu.org; Tue, 29 Jun 2021 08:21:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52346) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyCkM-0004l6-NX; Tue, 29 Jun 2021 08:21:46 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2388 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyCkM-0006jy-CH; Tue, 29 Jun 2021 08:21:46 -0400 In-Reply-To: <878s2tltc3.fsf@iki.fi> (message from Teemu Likonen on Mon, 28 Jun 2021 21:47:24 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209098 Archived-At: > From: Teemu Likonen > Cc: larsi@gnus.org, 43396@debbugs.gnu.org > Date: Mon, 28 Jun 2021 21:47:24 +0300 > > > And if, instead of custom-set-faces, you use > > > > (add-to-list 'default-frame-alist '(cursor-color . #0f0)) > > That works -- using the string "#0f0". The client session now has a > cursor with background color "#0f0". > > I sent my original report about "Customized 'cursor' face" after reading > Emacs reference manual section "(emacs) Cursor Display". It says: > > On a graphical display, many more properties of the text cursor can be > altered. To customize its color, change the ‘:background’ attribute of > the face named ‘cursor’ (*note Face Customization::). > > It seems to me that it's a bug if customizing cursor face doesn't work. But it does work, as you have just demonstrated. The color of the 'cursor' face does change -- except that it changes to a color that is the closest approximation on a text-mode frame to the color you requested. That's because the frame that is selected when the daemon applies the customizations via custom-set-faces is the daemon frame, which is not a GUI frame. > It would be odd to define that a feature, so that in normal session we > customize cursor face's background and in daemon we must use > default-frame-alist variable instead. custom-set-faces recalculates the face attributes and then applies those attributes to the frame(s). I don't know how to defer that recalculation to some future time, when a GUI frame is available, without hurting more important use cases with face customizations, which generally need such an immediate recalculation of attributes. Yes, we have a design bug here (and in some other places): customizations that need GUI features don't work well when invoked at startup time in daemon sessions. If someone knows how to fix custom-set-faces so that the face is re-evaluated when the first GUI frame is created, patches and/or ideas are welcome. Failing that, I thought I was doing well by helping you resolve this issue in your init files...