unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15427: 24.3.50; `customize-face' in Customize, show `Background' attribute using background
@ 2013-09-20 17:04 Drew Adams
  2019-08-15  3:36 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2013-09-20 17:04 UTC (permalink / raw)
  To: 15427

emacs -Q
M-x customize-face lazy-highlight

Attribute `Background' has its own `sample', which shows the color.
But it shows the color as a foreground (text).  Show it as the
background, instead.

This is independent of the overall `sample' for the face as a whole.
It's just more helpful to show the background color choice as a
background.



In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-08-31 on ODIEONE
Bzr revision: 114088 rgm@gnu.org-20130901021232-sazo0qla2qgcko95
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/binary --enable-checking=yes,glyphs
 'CFLAGS=-O0 -g3' LDFLAGS=-Lc:/Devel/emacs/lib
 CPPFLAGS=-Ic:/Devel/emacs/include'





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#15427: 24.3.50; `customize-face' in Customize, show `Background' attribute using background
  2013-09-20 17:04 bug#15427: 24.3.50; `customize-face' in Customize, show `Background' attribute using background Drew Adams
@ 2019-08-15  3:36 ` Lars Ingebrigtsen
  2019-08-15  4:44   ` Drew Adams
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-15  3:36 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15427

Drew Adams <drew.adams@oracle.com> writes:

> emacs -Q
> M-x customize-face lazy-highlight
>
> Attribute `Background' has its own `sample', which shows the color.
> But it shows the color as a foreground (text).  Show it as the
> background, instead.
>
> This is independent of the overall `sample' for the face as a whole.
> It's just more helpful to show the background color choice as a
> background.

There's a whole bunch of things that can have a colour when customising
a face -- like stipple background/foreground, overline, etc.  I don't
know whether it makes sense to special-case just the (main) background
colour...  but perhaps that does make sense, because it's a pretty
common thing to customise.  And showing the colour as a background
colour would give a more correct impressions.

But might be confusing if that one thing behaved differently than the
rest.

Anybody have an opinion here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#15427: 24.3.50; `customize-face' in Customize, show `Background' attribute using background
  2019-08-15  3:36 ` Lars Ingebrigtsen
@ 2019-08-15  4:44   ` Drew Adams
  2019-08-15 14:28   ` Eli Zaretskii
  2019-08-15 18:47   ` Juri Linkov
  2 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2019-08-15  4:44 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 15427

> > emacs -Q
> > M-x customize-face lazy-highlight
> >
> > Attribute `Background' has its own `sample', which shows the color.
> > But it shows the color as a foreground (text).  Show it as the
> > background, instead.
> >
> > This is independent of the overall `sample' for the face as a whole.
> > It's just more helpful to show the background color choice as a
> > background.
> 
> There's a whole bunch of things that can have a colour when customising
> a face -- like stipple background/foreground, overline, etc.  I don't
> know whether it makes sense to special-case just the (main) background
> colour...  but perhaps that does make sense, because it's a pretty
> common thing to customise.  And showing the colour as a background
> colour would give a more correct impressions.
> 
> But might be confusing if that one thing behaved differently than the
> rest.
> 
> Anybody have an opinion here?

It's _not_ about one thing behaving differently.

We show an overline, underline, foreground, etc.
attribute using the foreground, because they are,
well, in the foreground.

Attribute background is not.  Attribute background
should, well, show the color sample as background,
not as foreground.  (I would think that this is
obviously TRT to do.)





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#15427: 24.3.50; `customize-face' in Customize, show `Background' attribute using background
  2019-08-15  3:36 ` Lars Ingebrigtsen
  2019-08-15  4:44   ` Drew Adams
@ 2019-08-15 14:28   ` Eli Zaretskii
  2019-08-15 18:47   ` Juri Linkov
  2 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2019-08-15 14:28 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 15427

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Wed, 14 Aug 2019 20:36:13 -0700
> Cc: 15427@debbugs.gnu.org
> 
> Anybody have an opinion here?

My opinion is that there's nothing wrong with showing the color as
foreground.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#15427: 24.3.50; `customize-face' in Customize, show `Background' attribute using background
  2019-08-15  3:36 ` Lars Ingebrigtsen
  2019-08-15  4:44   ` Drew Adams
  2019-08-15 14:28   ` Eli Zaretskii
@ 2019-08-15 18:47   ` Juri Linkov
  2019-08-15 23:37     ` Lars Ingebrigtsen
  2 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2019-08-15 18:47 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 15427

>> emacs -Q
>> M-x customize-face lazy-highlight
>>
>> Attribute `Background' has its own `sample', which shows the color.
>> But it shows the color as a foreground (text).  Show it as the
>> background, instead.
>>
>> This is independent of the overall `sample' for the face as a whole.
>> It's just more helpful to show the background color choice as a
>> background.
>
> There's a whole bunch of things that can have a colour when customising
> a face -- like stipple background/foreground, overline, etc.  I don't
> know whether it makes sense to special-case just the (main) background
> colour...  but perhaps that does make sense, because it's a pretty
> common thing to customise.  And showing the colour as a background
> colour would give a more correct impressions.

Using background colors is more helpful for users.  Please see also
bug#33799 (set-foreground-color completion shows background colors).





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#15427: 24.3.50; `customize-face' in Customize, show `Background' attribute using background
  2019-08-15 18:47   ` Juri Linkov
@ 2019-08-15 23:37     ` Lars Ingebrigtsen
  2019-08-16  0:06       ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-15 23:37 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 15427

Juri Linkov <juri@linkov.net> writes:

> Using background colors is more helpful for users. 

I tried having a peek at the code to see whether this would be an easy
thing to fix, and it applies the colour here:

(defun widget-color-sample-face-get (widget)
  (let* ((value (condition-case nil
		    (widget-value widget)
		  (error (widget-get widget :value)))))
    (if (color-defined-p value)
	(list (cons 'foreground-color value))
      'default)))

But, as usual when dealing with widgets, I had to give up, because I can
never follow the calling logic (everything seems to happen somewhere
else), and I don't know how to inspect the widgets, either.

If somebody else wants to take a whack at it, be my guest.  It's
probably trivial if you know how widgets work.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#15427: 24.3.50; `customize-face' in Customize, show `Background' attribute using background
  2019-08-15 23:37     ` Lars Ingebrigtsen
@ 2019-08-16  0:06       ` Drew Adams
  0 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2019-08-16  0:06 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Juri Linkov; +Cc: 15427

FWIW, I agree about the widget and custom code.
And it's doc is not super helpful.

(defun widget-color-sample-face-get (widget)
  (let* ((value (condition-case nil
		    (widget-value widget)
		  (error (widget-get widget :value)))))
    (if (color-defined-p value)
	(list (cons 'background-color value))
      'default)))

But I think, as said in the enhancement
request, that it's good to show the
effect of the color BOTH as a foreground
and as a background.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-16  0:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-20 17:04 bug#15427: 24.3.50; `customize-face' in Customize, show `Background' attribute using background Drew Adams
2019-08-15  3:36 ` Lars Ingebrigtsen
2019-08-15  4:44   ` Drew Adams
2019-08-15 14:28   ` Eli Zaretskii
2019-08-15 18:47   ` Juri Linkov
2019-08-15 23:37     ` Lars Ingebrigtsen
2019-08-16  0:06       ` Drew Adams

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).