all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: luangruo@yahoo.com, 13476@debbugs.gnu.org, stephen.berman@gmx.net
Subject: bug#13476: 24.3.50; Reverting scroll-bar face customization has no effect
Date: Mon, 28 Feb 2022 12:25:06 -0300	[thread overview]
Message-ID: <621ce955.1c69fb81.a4520.6350@mx.google.com> (raw)
In-Reply-To: <83bkyrm4fv.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Feb 2022 16:49:40 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Mauro Aranda <maurooaranda@gmail.com>
>> Cc: luangruo@yahoo.com, 13476@debbugs.gnu.org, stephen.berman@gmx.net
>> Date: Mon, 28 Feb 2022 11:04:13 -0300
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> From: Mauro Aranda <maurooaranda@gmail.com>
>> >> 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.








  reply	other threads:[~2022-02-28 15:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17 11:12 bug#13476: 24.3.50; Reverting scroll-bar face customization has no effect Stephen Berman
2020-10-30 13:20 ` Mauro Aranda
2020-10-30 13:30   ` Eli Zaretskii
2020-10-30 14:18     ` Mauro Aranda
2020-10-30 21:46       ` Stephen Berman
2020-10-31  9:08       ` Eli Zaretskii
2020-10-31 20:14         ` Mauro Aranda
2020-11-01 14:19     ` Stefan Monnier
     [not found] ` <87bkyr68bf.fsf@yahoo.com>
2022-02-28 11:43   ` Mauro Aranda
2022-02-28 11:59     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-28 12:31       ` Mauro Aranda
2022-02-28 12:51         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-28 12:59           ` Mauro Aranda
2022-02-28 13:52             ` Eli Zaretskii
2022-02-28 14:04               ` Mauro Aranda
2022-02-28 14:49                 ` Eli Zaretskii
2022-02-28 15:25                   ` Mauro Aranda [this message]
2022-03-01  0:30                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-01 12:44                     ` Eli Zaretskii
2022-03-01 12:48                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=621ce955.1c69fb81.a4520.6350@mx.google.com \
    --to=maurooaranda@gmail.com \
    --cc=13476@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.