unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47313: 27.1; highlight functions should accept colors too
@ 2021-03-22  9:29 scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-03-22 17:34 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: scame via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-03-22  9:29 UTC (permalink / raw)
  To: 47313

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

I wanted to use highlight-regexp to color some lines gray, but the command
did not accept the color, it only accept faces, so I had to look for a suitable
face.

These highlight-* commands should accept color names too if the user
wants a specific color, not a specific face,

[-- Attachment #2: Type: text/html, Size: 360 bytes --]

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

* bug#47313: 27.1; highlight functions should accept colors too
  2021-03-22  9:29 bug#47313: 27.1; highlight functions should accept colors too scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-03-22 17:34 ` Eli Zaretskii
  2021-03-22 17:44   ` scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-03-22 17:34 UTC (permalink / raw)
  To: scame; +Cc: 47313

> Date: Mon, 22 Mar 2021 09:29:24 +0000
> From:  scame via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> I wanted to use highlight-regexp to color some lines gray, but the command
> did not accept the color, it only accept faces, so I had to look for a suitable
> face.
> 
> These highlight-* commands should accept color names too if the user
> wants a specific color, not a specific face,

Faces are not just colors, they have many additional attributes.

I'm not sure it is a good idea to make these commands accept both
faces and colors, as this could make the UI confusing and error prone.
It may be better to provide new commands, similar to the existing
ones, but which will accept only the colors instead of faces.

(You could of course define a face which specifies just the color, and
use that with highlight-* commands, but that is less user-friendly.)





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

* bug#47313: 27.1; highlight functions should accept colors too
  2021-03-22 17:34 ` Eli Zaretskii
@ 2021-03-22 17:44   ` scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-03-22 18:07     ` Eli Zaretskii
  2021-03-22 18:53     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: scame via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-03-22 17:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 47313@debbugs.gnu.org

>
> I'm not sure it is a good idea to make these commands accept both
> faces and colors, as this could make the UI confusing and error prone.
> It may be better to provide new commands, similar to the existing
> ones, but which will accept only the colors instead of faces.

I thought people only used colors to temporarily highlight certain phrases,
etc. If it's not true then you have a point that faces can do more.

At least, the face completion prompt should be improved, so that it shows
the face's style inline like with list-faces-display.This could solve
the color selection problem, because if the face's style is instantly
visible then the user can simply choose a face which is similar to the
color he wants.








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

* bug#47313: 27.1; highlight functions should accept colors too
  2021-03-22 17:44   ` scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-03-22 18:07     ` Eli Zaretskii
  2021-03-22 18:39       ` scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-03-22 18:53     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-03-22 18:07 UTC (permalink / raw)
  To: scame; +Cc: 47313

> Date: Mon, 22 Mar 2021 17:44:40 +0000
> From: scame <laszlomail@protonmail.com>
> Cc: "47313@debbugs.gnu.org" <47313@debbugs.gnu.org>
> 
> At least, the face completion prompt should be improved, so that it shows
> the face's style inline like with list-faces-display.This could solve
> the color selection problem, because if the face's style is instantly
> visible then the user can simply choose a face which is similar to the
> color he wants.

We could try that, but I fear that the result of showing many faces in
the same buffer one besides the other will look ugly, while displaying
them one face per line would make a very long buffer, scrolling
through which could be impractical.





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

* bug#47313: 27.1; highlight functions should accept colors too
  2021-03-22 18:07     ` Eli Zaretskii
@ 2021-03-22 18:39       ` scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-03-22 19:01         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: scame via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-03-22 18:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 47313@debbugs.gnu.org


>
> We could try that, but I fear that the result of showing many faces in
> the same buffer one besides the other will look ugly, while displaying
> them one face per line would make a very long buffer, scrolling
> through which could be impractical.

It can't be uglier than the completions of read-color which is pretty bad.
It's a cacophony of colors and some of them are hard to read:

https://i.imgur.com/NtIDihs.png

IMO the list-colors-display UI is much better even if it's longer (and if
it's a completion list then it's easy to narrow it down):

https://www.valenciatech.com/wp-content/uploads/2019/08/gnu-emacs-list-colors-display.png





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

* bug#47313: 27.1; highlight functions should accept colors too
  2021-03-22 17:44   ` scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-03-22 18:07     ` Eli Zaretskii
@ 2021-03-22 18:53     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-22 18:53 UTC (permalink / raw)
  To: scame; +Cc: 47313@debbugs.gnu.org

scame <laszlomail@protonmail.com> writes:

> I thought people only used colors to temporarily highlight certain phrases,
> etc. If it's not true then you have a point that faces can do more.

I think it makes sense to continue to use faces here (and not
colours) -- people may want underlining or overstrike or whatever.

Adding colours in addition to faces would be a confusing interface, I
think, so I don't think that would work well.  So I'm closing this bug
report.

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





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

* bug#47313: 27.1; highlight functions should accept colors too
  2021-03-22 18:39       ` scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-03-22 19:01         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-03-22 19:01 UTC (permalink / raw)
  To: scame; +Cc: 47313

> Date: Mon, 22 Mar 2021 18:39:11 +0000
> From: scame <laszlomail@protonmail.com>
> Cc: "47313@debbugs.gnu.org" <47313@debbugs.gnu.org>
> 
> > We could try that, but I fear that the result of showing many faces in
> > the same buffer one besides the other will look ugly, while displaying
> > them one face per line would make a very long buffer, scrolling
> > through which could be impractical.
> 
> It can't be uglier than the completions of read-color which is pretty bad.

I think it can.  But again, you are welcome to try that, perhaps I'm
wrong.

> It's a cacophony of colors and some of them are hard to read:
> 
> https://i.imgur.com/NtIDihs.png

I don't see any cacophony, and have no difficulty reading the names.
Besides, when you see the color itself, why does it matter how it is
named?

> 
> IMO the list-colors-display UI is much better even if it's longer (and if
> it's a completion list then it's easy to narrow it down):
> 
> https://www.valenciatech.com/wp-content/uploads/2019/08/gnu-emacs-list-colors-display.png

FWIW, I'd be annoyed by the length of this long before I found the
color I was after.  But that's me.





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

end of thread, other threads:[~2021-03-22 19:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22  9:29 bug#47313: 27.1; highlight functions should accept colors too scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-22 17:34 ` Eli Zaretskii
2021-03-22 17:44   ` scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-22 18:07     ` Eli Zaretskii
2021-03-22 18:39       ` scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-22 19:01         ` Eli Zaretskii
2021-03-22 18:53     ` Lars Ingebrigtsen

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).