unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How do I avoid purple-on-black and yellow-on-white?
@ 2014-02-02 21:36 Bruce Korb
  2014-02-02 23:47 ` Trent W. Buck
  0 siblings, 1 reply; 8+ messages in thread
From: Bruce Korb @ 2014-02-02 21:36 UTC (permalink / raw)
  To: emacs-devel

I needed to use emacs in a terminal window that was in reverse mode -- background black.
I was completely unable to read any of the prompts without highlighting the text
because the prompts are all purple.  Somehow, those two combinations need to be
prevented.  Completely.  Entirely.  Never allowed to happen at all.  It should not
be up to a hapless user to figure out how to configure coloration.  It's too hard.
Thanks you! :)



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

* Re: How do I avoid purple-on-black and yellow-on-white?
  2014-02-02 21:36 Bruce Korb
@ 2014-02-02 23:47 ` Trent W. Buck
  0 siblings, 0 replies; 8+ messages in thread
From: Trent W. Buck @ 2014-02-02 23:47 UTC (permalink / raw)
  To: emacs-devel

Bruce Korb <bruce.korb@gmail.com> writes:

> I needed to use emacs in a terminal window that was in reverse mode --
> background black.  I was completely unable to read any of the prompts
> without highlighting the text because the prompts are all purple.
> Somehow, those two combinations need to be prevented.  Completely.
> Entirely.  Never allowed to happen at all.  It should not be up to a
> hapless user to figure out how to configure coloration.  It's too
> hard.  Thanks you! :)

Emacs already does this for red foreground in eight-color terminals,
which IMO is bloody daft.  If X on Y is hard to read in your terminal,
FIX YOUR TERMINAL.  Don't reconfigure all your apps to avoid X/Y.

For example, I have this in ~/.profile when $TERM is linux:

  ## Use tango theme in 256-colour framebuffer console.
  printf '\033]P%s' \
    02E3436 1CC0000 24E9A06 3C4A000 43465A4 575507B 606989A 7D3D7CF \
    8555753 9EF2929 A8AE234 BFCE94F C729FCF DAD7FA8 E34E2E2 FEEEEEC
  ## Use a darker white, so it can be distinguished from
  ## brightwhite without overstriking.  Use *black* black.
  printf '\033]P%s' 0000000 7AAAAAA

For urxvt and xterm, use .Xresources; for libvte terminals there is
usually a menu option under something like Edit > Current Profile.

PS: most Emacs modes have two default color schemes -- dark background
and light background.  Because it can't ask the terminal, Emacs assumes
all terminals are dark background.  The easiest way to override that is
"emacs -fg black -bg white".

PPS: that's from memory, mostly of 22/23, so may be invalid now.




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

* How do I avoid purple-on-black and yellow-on-white?
@ 2014-02-03  1:52 Barry OReilly
  2014-02-04  0:21 ` Trent W. Buck
  0 siblings, 1 reply; 8+ messages in thread
From: Barry OReilly @ 2014-02-03  1:52 UTC (permalink / raw)
  To: bruce.korb, emacs-devel

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

Configuring Emacs to display white on black indeed seems
unpolished. When I started using Emacs, it took some experimentation
and web searching to arrive at:

  * Customize frame-background-mode 'dark
  * Customize inverse-video t (didn't observe this have any effect,
    but it looked relevant)
  * For graphical Emacs: run with -r flag
  * For Emacs in terminal (also configured white on black): run with
    -nw (no -r)

I didn't find a way to drop the -r flag in favor of pure Elisp config,
and still get good display.

I use graphical most of the time so don't generally notice terminal
display issues. Under this setup, the terminal colors are very
different from the graphical, but a brief look didn't uncover any poor
contrast.

In your case, the frame-background-mode variable makes the difference
between minibuffer-prompt face being medium blue or cyan, the latter
having better contrast on black. To confirm the value of that face, do
M-x customize-face RET minibuffer-prompt RET.

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

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

* Re: How do I avoid purple-on-black and yellow-on-white?
  2014-02-03  1:52 How do I avoid purple-on-black and yellow-on-white? Barry OReilly
@ 2014-02-04  0:21 ` Trent W. Buck
  2014-02-04  0:41   ` Bruce Korb
  0 siblings, 1 reply; 8+ messages in thread
From: Trent W. Buck @ 2014-02-04  0:21 UTC (permalink / raw)
  To: emacs-devel

Barry OReilly <gundaetiapo@gmail.com> writes:

> I use graphical most of the time so don't generally notice terminal
> display issues. Under this setup, the terminal colors are very
> different from the graphical, but a brief look didn't uncover any poor
> contrast.

Probably because you were on a terminal that claimed 8-color support (16
if it treats bold as "bright colors").  With 256-color terminals, the
difference is much less noticable.

You can test easily with "tput colors".

With the appropriate package installed (e.g. "ncurses-base" on Debian),
you can change your terminal from e.g. TERM=xterm to
TERM=xterm-256color, and Emacs will use nonstandard escape sequences to
produce eight-bit colors.

If you've also customized the basic 16 colors, this can look strange :-)

M-x list-colors-display RET to have a look.

If that looks mostly blue-green, you're mixing up 256 and 88 color
terminals.  This used to arise with urxvt; I don't know if it supports
256 colors yet.

Eight-color sequences are portable between terminals, see tput(1) and
terminfo(5) ref. setaf, setab, bold and sgr0.

88/256 color sequences are not portable, but IME all use the xterm
sequences.  For these, M-x find library RET term/xterm RET, also see
xterm(1).

I've avoided 256-color terminals for many years, because they oblige me
to theme apps instead of just the terminal (and 8 colors is usually
enough for me).  Back when I did, I wrote some notes:
http://www.cyber.com.au/~twb/doc/term256.txt


Hopefully this brain dump is useful to someone :-)




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

* Re: How do I avoid purple-on-black and yellow-on-white?
  2014-02-04  0:21 ` Trent W. Buck
@ 2014-02-04  0:41   ` Bruce Korb
  2014-02-04  3:26     ` Stefan Monnier
  2014-02-07 19:54     ` Juri Linkov
  0 siblings, 2 replies; 8+ messages in thread
From: Bruce Korb @ 2014-02-04  0:41 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs development

I guess I am just lazy.  I don't care about setting weirdo terminal modes.
I am not interested in a full palate of subtle color differences.
Black and white worked just fine.  Having several contrasting colors
is very nice so I can see a clear distinction between comments and
regular code.  That is all very nice indeed.  But when you start having
dozens of colors, the contrast between some of the colors is not
going to be very great.  But there should be a few fundamental
rules that emacs obeys:

1. if the background is white, do not use yellow for anything
2. if the background is dark, do not use purple or dark blue for anything.

If you want a subtle color difference between normal comments and
Doxygenated comments, fine.  It is just simply that the contrast
between any characters and their background *MUST NOT BE SUBTLE*
and I should not be required to go do hours of research to figure out
how to fiddle settings so that it doesn't happen.  I bumped into
dark purple on black and the result could not be read (without highlighting
the text, and even then it was not easy.)

Thank you.  Regards, Bruce



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

* Re: How do I avoid purple-on-black and yellow-on-white?
@ 2014-02-04  2:53 Barry OReilly
  0 siblings, 0 replies; 8+ messages in thread
From: Barry OReilly @ 2014-02-04  2:53 UTC (permalink / raw)
  To: bruce.korb, emacs-devel

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

> I should not be required to go do hours of research to figure out
> how to fiddle settings so that it doesn't happen.

Agreed. You could submit the issue via report-emacs-bug.

The doc for frame-background-mode says "nil (automatic by default) if
you want Emacs to examine the brightness for you". It is not
evidently doing so in this case, because for me:

  emacs -nw -Q
  M-x customize-face RET minbuffer-prompt

shows medium blue rather than the expected cyan, using mate-terminal
configured to white on black in a Mint 12.04 install.

So Someone needs to investigate whether there's a way to determine the
terminal color settings and have the "automatic by default" behavior
cause the defined faces to use their "dark background" settings.

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

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

* Re: How do I avoid purple-on-black and yellow-on-white?
  2014-02-04  0:41   ` Bruce Korb
@ 2014-02-04  3:26     ` Stefan Monnier
  2014-02-07 19:54     ` Juri Linkov
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2014-02-04  3:26 UTC (permalink / raw)
  To: Bruce Korb; +Cc: Trent W. Buck, emacs development

> I bumped into dark purple on black and the result could not be read
> (without highlighting the text, and even then it was not easy.)

Normally the solution (as has already been pointed out) is to explain to
Emacs that your background is dark (which is something that it sadly
can't determine on its own in this case, AFAIK).

Have you tried it?


        Stefan



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

* Re: How do I avoid purple-on-black and yellow-on-white?
  2014-02-04  0:41   ` Bruce Korb
  2014-02-04  3:26     ` Stefan Monnier
@ 2014-02-07 19:54     ` Juri Linkov
  1 sibling, 0 replies; 8+ messages in thread
From: Juri Linkov @ 2014-02-07 19:54 UTC (permalink / raw)
  To: emacs-devel

> 1. if the background is white, do not use yellow for anything

On a graphical display, shell mode often displays illegible
yellow-on-white output because the default value of
`ansi-color-names-vector' contains "yellow".  It would help to use
the same color like is used on a text terminal that is "yellow3".
Then other colors could be copied from `xterm-standard-colors' as well:

=== modified file 'lisp/ansi-color.el'
--- lisp/ansi-color.el	2014-01-01 07:43:34 +0000
+++ lisp/ansi-color.el	2014-02-07 19:54:27 +0000
@@ -117,7 +117,7 @@ (defcustom ansi-color-faces-vector
   :group 'ansi-colors)
 
 (defcustom ansi-color-names-vector
-  ["black" "red" "green" "yellow" "blue" "magenta" "cyan" "white"]
+  ["black" "red3" "green3" "yellow3" "blue2" "magenta3" "cyan3" "gray90"]
   "Colors used for SGR control sequences determining a color.
 This vector holds the colors used for SGR control sequences parameters
 30 to 37 (foreground colors) and 40 to 47 (background colors).




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

end of thread, other threads:[~2014-02-07 19:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-03  1:52 How do I avoid purple-on-black and yellow-on-white? Barry OReilly
2014-02-04  0:21 ` Trent W. Buck
2014-02-04  0:41   ` Bruce Korb
2014-02-04  3:26     ` Stefan Monnier
2014-02-07 19:54     ` Juri Linkov
  -- strict thread matches above, loose matches on Subject: below --
2014-02-04  2:53 Barry OReilly
2014-02-02 21:36 Bruce Korb
2014-02-02 23:47 ` Trent W. Buck

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