From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#13476: 24.3.50; Reverting scroll-bar face customization has no effect Date: Mon, 28 Feb 2022 12:25:06 -0300 Message-ID: <621ce955.1c69fb81.a4520.6350@mx.google.com> References: <621cd660.1c69fb81.2604f.da8d@mx.google.com> <83bkyrm4fv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3583"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: luangruo@yahoo.com, 13476@debbugs.gnu.org, stephen.berman@gmx.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 28 16:26:17 2022 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 1nOhui-0000iB-Ok for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Feb 2022 16:26:16 +0100 Original-Received: from localhost ([::1]:56126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOhuh-0007bQ-9P for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Feb 2022 10:26:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOhuU-0007a8-LZ for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2022 10:26:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOhuU-00009i-D7 for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2022 10:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOhuT-0002vl-Ux for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2022 10:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Feb 2022 15:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13476 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 13476-submit@debbugs.gnu.org id=B13476.164606191811194 (code B ref 13476); Mon, 28 Feb 2022 15:26:01 +0000 Original-Received: (at 13476) by debbugs.gnu.org; 28 Feb 2022 15:25:18 +0000 Original-Received: from localhost ([127.0.0.1]:34565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOhtl-0002uU-Tl for submit@debbugs.gnu.org; Mon, 28 Feb 2022 10:25:18 -0500 Original-Received: from mail-oi1-f171.google.com ([209.85.167.171]:36646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOhtj-0002uD-LZ for 13476@debbugs.gnu.org; Mon, 28 Feb 2022 10:25:16 -0500 Original-Received: by mail-oi1-f171.google.com with SMTP id p15so13506778oip.3 for <13476@debbugs.gnu.org>; Mon, 28 Feb 2022 07:25:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:from:to:cc:subject:references:date:in-reply-to :user-agent:mime-version; bh=YOr1k4lvmfYKz1hesHDWYPv75G7KJEWRjIGb1vouYAg=; b=qxwsdb5ode1XXoPC/+yuBCde34a+q3AdHuYlHHfc+Z53SkiW0A7AMWvmm1G0tyomZa bXny/uC7K9+yWz4iGenF0Bgs7VLTszVOObDKWV8kKvsP1u5i5zzLNVx5jnrC9v8zW3xq D9av/GLjWyCNwRjJzuvsK774SdAu/hRtUA0YyrWRBpTXkjNP3+xjrjv6fVuLA5boC2VL 4xCi8gW1fe5YrnvnrkHw+mw8OC1MW28j1nL3edEhpYVWXD9xJHlsgg2CptRTKFmRpLop wejpN6RM5hzxukWEEw7k7gtmCgb+zyS0WX/SNaxAhzj+TE4zHnODgox5jIcHiDdmEnxJ SzwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:from:to:cc:subject:references:date :in-reply-to:user-agent:mime-version; bh=YOr1k4lvmfYKz1hesHDWYPv75G7KJEWRjIGb1vouYAg=; b=JKLjhvgXC1fwpUUvo10JoGhwjYGhA0C2SW7j6xO+TlcAPmJpEj2mS8bua/swlKqYMy 3ciITWx2V8prGlMX6DCKvq8JF2djmNO1fQyDUrV/p5+wHSY9MO0+gy3d9vpPyhUJ26DS uaap/VkESOFYCABzYEgRTqGVqdV8oRuJaex7ilKmVzzWtJuD1rxokrGP7syqEf2YLnlp m2R/zp4BMsIwgAAJNIm2Lm/31mGePn0JRdZ1A0zy5FXe8KQk11gpJY3bXW4OvFjdyEk1 nIL0wlDQOzhqKDnmkRwWB0nhv4x3jonl2Ni71Msb3QPwMp92Cub5P9kJtM83iLRlx8ib ugqg== X-Gm-Message-State: AOAM530cKjIyGrf2zZynQ6RKHMHQy3+33znS5/J6JDoLfKSDNWdCWGyU n8o30oEgXLtaoPSJGNLzsA0= X-Google-Smtp-Source: ABdhPJze55n85EBEuaExt7lJkkewcLnyyN5eY6GpuNrVE03/KcJl0dY/OgIsdOJnZsIkxrmjnAIJ7g== X-Received: by 2002:a05:6808:148b:b0:2d7:1243:e7e0 with SMTP id e11-20020a056808148b00b002d71243e7e0mr9186936oiw.96.1646061910014; Mon, 28 Feb 2022 07:25:10 -0800 (PST) Original-Received: from tbb-desktop ([181.29.189.16]) by smtp.gmail.com with ESMTPSA id y8-20020a544d88000000b002d525da014bsm6193149oix.42.2022.02.28.07.25.08 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Feb 2022 07:25:09 -0800 (PST) X-Google-Original-Message-ID: <87sfs3ovxp.fsf@maurooaranda@gmail.com> In-Reply-To: <83bkyrm4fv.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Feb 2022 16:49:40 +0200") 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:227826 Archived-At: Eli Zaretskii writes: >> From: Mauro Aranda >> Cc: luangruo@yahoo.com, 13476@debbugs.gnu.org, stephen.berman@gmx.net >> Date: Mon, 28 Feb 2022 11:04:13 -0300 >> >> Eli Zaretskii writes: >> >> >> From: Mauro Aranda >> >> Cc: eliz@gnu.org, 13476@debbugs.gnu.org, stephen.berman@gmx.net >> >> Date: Mon, 28 Feb 2022 09:59:15 -0300 >> >> >> >> > --- a/lisp/faces.el >> >> > +++ b/lisp/faces.el >> >> > @@ -1743,7 +1743,14 @@ The following sources are applied in this order: >> >> > (and tail (face-spec-set-2 face frame >> >> > (list :extend (cadr tail)))))) >> >> > (setq face-attrs (face-spec-choose (get face 'face-override-spec) frame)) >> >> > - (face-spec-set-2 face frame face-attrs))) >> >> > + (face-spec-set-2 face frame face-attrs) >> >> > + (when (and (fboundp 'set-frame-parameter) ; This isn't available >> >> > + ; during loadup. >> >> > + (eq face 'scroll-bar)) >> >> > + ;; Set the `scroll-bar-foreground' and `scroll-bar-background' >> >> > + ;; frame parameters. (bug#13476) >> >> > + (set-frame-parameter frame 'scroll-bar-foreground (face-foreground face)) >> >> > + (set-frame-parameter frame 'scroll-bar-background (face-background face))))) >> > >> > Why do we need this special treatment of the scroll-bar face? >> >> I haven't read the code yet so I can't really answer to your question. What >> I know is what I said on >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=13476#8 >> >> Customizing and then resetting to the standard scroll-bar face failed >> because the 'scroll-bar-foreground parameter wasn't updated after >> resetting the attributes via face-spec-reset-face. > > I don't understand why we need to set the frame parameter when the > customize the face to begin with, I guess. In an Emacs prior to c307c9648d541338814fe541389ea8c7a1cf50a5 and configured with: --without-toolkit-scroll-bars M-x customize-face RET scroll-bar Customize the foreground color to "green", and set for current session. Click the State button to "Revert This Session's Customization". The scroll bar stays green, even when the foreground color says it is black. Evaluate the following: (face-attribute 'scroll-bar :foreground nil 'default) ; ==> "black" (frame-parameter (selected-frame) 'scroll-bar-foreground) ; ==> "green" So, AFAIU the reason the scroll bar stayed green even after the attempt to go back to the standard was that the frame parameter didn't change after evaluating (face-spec-reset 'scroll-bar nil 'reset) Giving the scroll-bar face a non-trivial spec worked because it caused some code in internal-set-lisp-face-attribute to update the frame parameter, but it looks like it caused bad side effects when using some toolkits.