unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* incomplete comment colorization in terminals
@ 2008-03-11 23:15 Rob Riepel
  2008-03-12  4:26 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Rob Riepel @ 2008-03-11 23:15 UTC (permalink / raw)
  To: emacs-pretest-bug

When using font-locking in a terminal window (xterm and the like)
single-line comments are only highlighted to the first non-space
character after a space.  This happens in more than one language-
specific mode - I've tried Emacs-lisp and CPerl modes.

The bug does not occur when running Emacs under X, only in a terminal,
and only for certain terminal types.  The bug is present when TERM is
set to xterm or xterm-color, but not when TERM is set to xterm-16color.

This bug is in 22.1 and the pretest version of Emacs, so it is not new.
Emacs 21 does not have this bug.

Here are some screen shots showing the problem:

xterm-color with the bug:

  http://www.stanford.edu/~riepel/emacs/bug/xterm.png

xterm-16color without the bug:

  http://www.stanford.edu/~riepel/emacs/bug/xterm-16color.png

xterm-color with X selection to show exact end of highlights:

  http://www.stanford.edu/~riepel/emacs/bug/xterm-hilited.png

xterm-16color with X selection for completeness:

  http://www.stanford.edu/~riepel/emacs/bug/xterm-16color-hilited.png

If this bug turns out to be in ncurses or term{cap,info} please let me
know so I can submit a bug report to them.



In GNU Emacs 22.1.92.1 (i686-pc-linux-gnu, X toolkit)
 of 2008-03-11 on daedalus
configured using `configure  '--prefix=/usr/yocal''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  tpu-edt-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-j C-n r e p o r t - e m TAB RET

Recent messages:
Loading minibuffer-complete-cycle...
Loading byte-opt...done
Loading minibuffer-complete-cycle...done
Loading /home/riepel/.tpu-control...done
For information about GNU Emacs and the GNU system, type <f1> C-a.
(New file)
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done
call-interactively: Text is read-only [3 times]




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

* Re: incomplete comment colorization in terminals
  2008-03-11 23:15 incomplete comment colorization in terminals Rob Riepel
@ 2008-03-12  4:26 ` Eli Zaretskii
  2008-03-12  6:44   ` Dan Nicolaescu
  2008-03-15  0:49   ` Rob Riepel
  2008-03-12  4:45 ` Dan Nicolaescu
  2008-03-12 13:10 ` Stefan Monnier
  2 siblings, 2 replies; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-12  4:26 UTC (permalink / raw)
  To: Rob Riepel; +Cc: emacs-pretest-bug

> From: Rob Riepel <riepel@networking.stanford.edu>
> Date: Tue, 11 Mar 2008 16:15:14 -0700 (PDT)
> Cc: 
> 
> When using font-locking in a terminal window (xterm and the like)
> single-line comments are only highlighted to the first non-space
> character after a space.  This happens in more than one language-
> specific mode - I've tried Emacs-lisp and CPerl modes.
> 
> The bug does not occur when running Emacs under X, only in a terminal,
> and only for certain terminal types.  The bug is present when TERM is
> set to xterm or xterm-color, but not when TERM is set to xterm-16color.

This is not a bug, but a deliberate feature.  There's a new face named
font-lock-comment-delimiter-face.




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

* Re: incomplete comment colorization in terminals
  2008-03-11 23:15 incomplete comment colorization in terminals Rob Riepel
  2008-03-12  4:26 ` Eli Zaretskii
@ 2008-03-12  4:45 ` Dan Nicolaescu
  2008-03-12 13:57   ` Stefan Monnier
  2008-03-12 13:10 ` Stefan Monnier
  2 siblings, 1 reply; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-12  4:45 UTC (permalink / raw)
  To: Rob Riepel; +Cc: emacs-pretest-bug

Rob Riepel <riepel@networking.stanford.edu> writes:

  > When using font-locking in a terminal window (xterm and the like)
  > single-line comments are only highlighted to the first non-space
  > character after a space.  This happens in more than one language-
  > specific mode - I've tried Emacs-lisp and CPerl modes.
  > 
  > The bug does not occur when running Emacs under X, only in a terminal,
  > and only for certain terminal types.  The bug is present when TERM is
  > set to xterm or xterm-color, but not when TERM is set to xterm-16color.

A good way to avoid this, and the recommended way run emacs in a
terminal emulator, is to set TERM to xterm-256color.  All current
xterm compatible terminal emulators support 256 colors, when using that
your colors will look almost the same in the terminal as the do in X.




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

* Re: incomplete comment colorization in terminals
  2008-03-12  4:26 ` Eli Zaretskii
@ 2008-03-12  6:44   ` Dan Nicolaescu
  2008-03-12  8:17     ` Nick Roberts
  2008-03-15  0:49   ` Rob Riepel
  1 sibling, 1 reply; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-12  6:44 UTC (permalink / raw)
  To: Eli Zaretskii, Stefan Monnier, Chong Yidong; +Cc: Rob Riepel, emacs-pretest-bug

Eli Zaretskii <eliz@gnu.org> writes:

  > > From: Rob Riepel <riepel@networking.stanford.edu>
  > > Date: Tue, 11 Mar 2008 16:15:14 -0700 (PDT)
  > > Cc: 
  > > 
  > > When using font-locking in a terminal window (xterm and the like)
  > > single-line comments are only highlighted to the first non-space
  > > character after a space.  This happens in more than one language-
  > > specific mode - I've tried Emacs-lisp and CPerl modes.
  > > 
  > > The bug does not occur when running Emacs under X, only in a terminal,
  > > and only for certain terminal types.  The bug is present when TERM is
  > > set to xterm or xterm-color, but not when TERM is set to xterm-16color.
  > 
  > This is not a bug, but a deliberate feature.  There's a new face named
  > font-lock-comment-delimiter-face.

This feature was introduced because on the Linux console the comment
face was hard to read (red on black).  But this feature also applies to
the 8 color xterm with a white background, which nobody complained
about! The comment face is quite readable on such a terminal. The face
was changed in that case for no reason.

So can we please switch the 8 color light background case back to
normal? 

Stefan and Yidong, what do you think?




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

* Re: incomplete comment colorization in terminals
  2008-03-12  6:44   ` Dan Nicolaescu
@ 2008-03-12  8:17     ` Nick Roberts
  2008-03-12 13:54       ` Stefan Monnier
  2008-03-12 17:51       ` Richard Stallman
  0 siblings, 2 replies; 27+ messages in thread
From: Nick Roberts @ 2008-03-12  8:17 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Rob Riepel, emacs-pretest-bug, Eli Zaretskii

 >   > This is not a bug, but a deliberate feature.  There's a new face named
 >   > font-lock-comment-delimiter-face.
 > 
 > This feature was introduced because on the Linux console the comment
 > face was hard to read (red on black).

That's not my recollection.  Indeed red is very easy to see on black when
there is sufficient brightness.  ISTR that RMS added it to minimise power
consumption on laptops.

-- 
Nick                                           http://www.inet.net.nz/~nickrob




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

* Re: incomplete comment colorization in terminals
  2008-03-11 23:15 incomplete comment colorization in terminals Rob Riepel
  2008-03-12  4:26 ` Eli Zaretskii
  2008-03-12  4:45 ` Dan Nicolaescu
@ 2008-03-12 13:10 ` Stefan Monnier
  2 siblings, 0 replies; 27+ messages in thread
From: Stefan Monnier @ 2008-03-12 13:10 UTC (permalink / raw)
  To: Rob Riepel; +Cc: emacs-pretest-bug

> When using font-locking in a terminal window (xterm and the like)
> single-line comments are only highlighted to the first non-space
> character after a space.  This happens in more than one language-
> specific mode - I've tried Emacs-lisp and CPerl modes.

Check C-h N.
I know it's long but if you search for "comment" you'll probably find it
fairly quickly.


        Stefan




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

* Re: incomplete comment colorization in terminals
  2008-03-12  8:17     ` Nick Roberts
@ 2008-03-12 13:54       ` Stefan Monnier
  2008-03-12 15:07         ` Dan Nicolaescu
  2008-03-12 17:51       ` Richard Stallman
  1 sibling, 1 reply; 27+ messages in thread
From: Stefan Monnier @ 2008-03-12 13:54 UTC (permalink / raw)
  To: Nick Roberts; +Cc: Rob Riepel, emacs-pretest-bug, Eli Zaretskii, Dan Nicolaescu

>> > This is not a bug, but a deliberate feature.  There's a new face named
>> > font-lock-comment-delimiter-face.
>> 
>> This feature was introduced because on the Linux console the comment
>> face was hard to read (red on black).

> That's not my recollection.  Indeed red is very easy to see on black when
> there is sufficient brightness.  ISTR that RMS added it to minimise power
> consumption on laptops.

Well, it's kind of a jump, but IIRC it's not completely off-the-mark:
Richard complained that the font-lock-comment-face was unreadable on his
screen, and the reason was partly that he kept the brightness of his
screen at minimum to maximize battery autonomy.


        Stefan




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

* Re: incomplete comment colorization in terminals
  2008-03-12  4:45 ` Dan Nicolaescu
@ 2008-03-12 13:57   ` Stefan Monnier
  2008-03-13  6:40     ` Dan Nicolaescu
  2008-03-15  0:50     ` Rob Riepel
  0 siblings, 2 replies; 27+ messages in thread
From: Stefan Monnier @ 2008-03-12 13:57 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Rob Riepel, emacs-pretest-bug

>> When using font-locking in a terminal window (xterm and the like)
>> single-line comments are only highlighted to the first non-space
>> character after a space.  This happens in more than one language-
>> specific mode - I've tried Emacs-lisp and CPerl modes.
>> 
>> The bug does not occur when running Emacs under X, only in a terminal,
>> and only for certain terminal types.  The bug is present when TERM is
>> set to xterm or xterm-color, but not when TERM is set to xterm-16color.

> A good way to avoid this, and the recommended way run emacs in a
> terminal emulator, is to set TERM to xterm-256color.  All current
> xterm compatible terminal emulators support 256 colors, when using that
> your colors will look almost the same in the terminal as the do in X.

The NEWS entry for font-lock-comment-delimiter-face in Emacs-22 is
insufficient I believe.  It should explain the effect of the
introduction of this new face and should point to xterm-256color as well
as other methods to recover the previous behavior.


        Stefan




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

* Re: incomplete comment colorization in terminals
  2008-03-12 13:54       ` Stefan Monnier
@ 2008-03-12 15:07         ` Dan Nicolaescu
  0 siblings, 0 replies; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-12 15:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Rob Riepel, emacs-pretest-bug, Nick Roberts, Eli Zaretskii

Stefan Monnier <monnier@iro.umontreal.ca> writes:

  > >> > This is not a bug, but a deliberate feature.  There's a new face named
  > >> > font-lock-comment-delimiter-face.
  > >> 
  > >> This feature was introduced because on the Linux console the comment
  > >> face was hard to read (red on black).
  > 
  > > That's not my recollection.  Indeed red is very easy to see on black when
  > > there is sufficient brightness.  ISTR that RMS added it to minimise power
  > > consumption on laptops.
  > 
  > Well, it's kind of a jump, but IIRC it's not completely off-the-mark:
  > Richard complained that the font-lock-comment-face was unreadable on his
  > screen, and the reason was partly that he kept the brightness of his
  > screen at minimum to maximize battery autonomy.

Exactly, but still, the problem was exclusively with a dark background,
there was no complaint whatsoever about the light background case.
There's no reason to have this behavior for the 8 color light background
case.  So, can we please restore it?




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

* Re: incomplete comment colorization in terminals
  2008-03-12  8:17     ` Nick Roberts
  2008-03-12 13:54       ` Stefan Monnier
@ 2008-03-12 17:51       ` Richard Stallman
  2008-03-13  6:38         ` Dan Nicolaescu
  1 sibling, 1 reply; 27+ messages in thread
From: Richard Stallman @ 2008-03-12 17:51 UTC (permalink / raw)
  To: Nick Roberts; +Cc: riepel, emacs-pretest-bug, eliz, dann

     > This feature was introduced because on the Linux console the comment
     > face was hard to read (red on black).

    That's not my recollection.  Indeed red is very easy to see on black when
    there is sufficient brightness.  ISTR that RMS added it to minimise power
    consumption on laptops.

The former is correct -- I found it hard to read comment text in red
against the black background.  I don't think that this was limited only
to when I had the brightness turned down, I think it was always.

In any case, I would not mind if some other change is made for the
white background case.




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

* Re: incomplete comment colorization in terminals
  2008-03-12 17:51       ` Richard Stallman
@ 2008-03-13  6:38         ` Dan Nicolaescu
  2008-03-13 22:24           ` Richard Stallman
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-13  6:38 UTC (permalink / raw)
  To: rms; +Cc: riepel, emacs-pretest-bug, Nick Roberts, eliz

Richard Stallman <rms@gnu.org> writes:

  > In any case, I would not mind if some other change is made for the
  > white background case.

Thanks. I have done that.

We can actually completely get rid of `font-lock-comment-delimiter-face'
if the color for the dark background, 8 colors is changed to "yellow".
"yellow" is very readable on a black background. It will appear as
orange on the Linux console, which is also very readable.

Of the font-lock faces only font-lock-variable-name-face uses
"yellow". The 2 faces tend to appear in different contexts, so there
should not be a big problem in using the same color for both.

What do you think?





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

* Re: incomplete comment colorization in terminals
  2008-03-12 13:57   ` Stefan Monnier
@ 2008-03-13  6:40     ` Dan Nicolaescu
  2008-03-13 15:01       ` Stefan Monnier
  2008-03-15  0:50     ` Rob Riepel
  1 sibling, 1 reply; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-13  6:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Rob Riepel, emacs-pretest-bug

Stefan Monnier <monnier@iro.umontreal.ca> writes:

  > >> When using font-locking in a terminal window (xterm and the like)
  > >> single-line comments are only highlighted to the first non-space
  > >> character after a space.  This happens in more than one language-
  > >> specific mode - I've tried Emacs-lisp and CPerl modes.
  > >> 
  > >> The bug does not occur when running Emacs under X, only in a terminal,
  > >> and only for certain terminal types.  The bug is present when TERM is
  > >> set to xterm or xterm-color, but not when TERM is set to xterm-16color.
  > 
  > > A good way to avoid this, and the recommended way run emacs in a
  > > terminal emulator, is to set TERM to xterm-256color.  All current
  > > xterm compatible terminal emulators support 256 colors, when using that
  > > your colors will look almost the same in the terminal as the do in X.
  > 
  > The NEWS entry for font-lock-comment-delimiter-face in Emacs-22 is
  > insufficient I believe.  It should explain the effect of the
  > introduction of this new face and should point to xterm-256color as well
  > as other methods to recover the previous behavior.

Should we add a new entry for emacs-22.2 to correct these issues?
It might be too close to the release, but maybe we could apply the
change for the light background case?




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

* Re: incomplete comment colorization in terminals
  2008-03-13  6:40     ` Dan Nicolaescu
@ 2008-03-13 15:01       ` Stefan Monnier
  2008-03-13 18:55         ` Glenn Morris
  2008-03-19  4:02         ` Dan Nicolaescu
  0 siblings, 2 replies; 27+ messages in thread
From: Stefan Monnier @ 2008-03-13 15:01 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Rob Riepel, emacs-pretest-bug

>> >> When using font-locking in a terminal window (xterm and the like)
>> >> single-line comments are only highlighted to the first non-space
>> >> character after a space.  This happens in more than one language-
>> >> specific mode - I've tried Emacs-lisp and CPerl modes.
>> >> 
>> >> The bug does not occur when running Emacs under X, only in a terminal,
>> >> and only for certain terminal types.  The bug is present when TERM is
>> >> set to xterm or xterm-color, but not when TERM is set to xterm-16color.
>> 
>> > A good way to avoid this, and the recommended way run emacs in a
>> > terminal emulator, is to set TERM to xterm-256color.  All current
>> > xterm compatible terminal emulators support 256 colors, when using that
>> > your colors will look almost the same in the terminal as the do in X.
>> 
>> The NEWS entry for font-lock-comment-delimiter-face in Emacs-22 is
>> insufficient I believe.  It should explain the effect of the
>> introduction of this new face and should point to xterm-256color as well
>> as other methods to recover the previous behavior.

> Should we add a new entry for emacs-22.2 to correct these issues?

Yes, please.

> It might be too close to the release, but maybe we could apply the
> change for the light background case?

If noone objects, it's fine by me.


        Stefan




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

* Re: incomplete comment colorization in terminals
  2008-03-13 15:01       ` Stefan Monnier
@ 2008-03-13 18:55         ` Glenn Morris
  2008-03-13 21:52           ` Dan Nicolaescu
  2008-03-14  4:16           ` Dan Nicolaescu
  2008-03-19  4:02         ` Dan Nicolaescu
  1 sibling, 2 replies; 27+ messages in thread
From: Glenn Morris @ 2008-03-13 18:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Rob Riepel, emacs-pretest-bug, Dan Nicolaescu

Stefan Monnier wrote:

>> Should we add a new entry for emacs-22.2 to correct these issues?
>
> Yes, please.

I already did.

>> It might be too close to the release, but maybe we could apply the
>> change for the light background case?
>
> If noone objects, it's fine by me.

I don't mean to be difficult, but I wouldn't. Default font settings
are ridiculously controversial, and I think it's best to just leave
well alone at this stage.




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

* Re: incomplete comment colorization in terminals
  2008-03-13 18:55         ` Glenn Morris
@ 2008-03-13 21:52           ` Dan Nicolaescu
  2008-03-14  4:16           ` Dan Nicolaescu
  1 sibling, 0 replies; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-13 21:52 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Rob Riepel, emacs-pretest-bug, Stefan Monnier

Glenn Morris <rgm@gnu.org> writes:

  > Stefan Monnier wrote:

  > >> It might be too close to the release, but maybe we could apply the
  > >> change for the light background case?
  > >
  > > If noone objects, it's fine by me.
  > 
  > I don't mean to be difficult, but I wouldn't. Default font settings
  > are ridiculously controversial, and I think it's best to just leave
  > well alone at this stage.

This change will reduce controversies, not generate them...




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

* Re: incomplete comment colorization in terminals
  2008-03-13  6:38         ` Dan Nicolaescu
@ 2008-03-13 22:24           ` Richard Stallman
  2008-03-13 22:44             ` Dan Nicolaescu
  0 siblings, 1 reply; 27+ messages in thread
From: Richard Stallman @ 2008-03-13 22:24 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: riepel, emacs-pretest-bug, nickrob, eliz

    We can actually completely get rid of `font-lock-comment-delimiter-face'
    if the color for the dark background, 8 colors is changed to "yellow".
    "yellow" is very readable on a black background. It will appear as
    orange on the Linux console, which is also very readable.

I tried that in `font-lock-comment-face', and it is ok, but having the
text in white is clearer and easier to read.




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

* Re: incomplete comment colorization in terminals
  2008-03-13 22:24           ` Richard Stallman
@ 2008-03-13 22:44             ` Dan Nicolaescu
  2008-03-14  0:21               ` Nick Roberts
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-13 22:44 UTC (permalink / raw)
  To: rms; +Cc: riepel, emacs-pretest-bug, nickrob, eliz

Richard Stallman <rms@gnu.org> writes:

  >     We can actually completely get rid of `font-lock-comment-delimiter-face'
  >     if the color for the dark background, 8 colors is changed to "yellow".
  >     "yellow" is very readable on a black background. It will appear as
  >     orange on the Linux console, which is also very readable.
  > 
  > I tried that in `font-lock-comment-face', and it is ok, 

In that case, please let's go with that solution, it is the lower
complexity solution, and less surprising for the user.  We have gotten a
few bug reports from users that were confused by this (it is not
immediately intuitive).




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

* Re: incomplete comment colorization in terminals
  2008-03-13 22:44             ` Dan Nicolaescu
@ 2008-03-14  0:21               ` Nick Roberts
  2008-03-14  0:34                 ` Dan Nicolaescu
  0 siblings, 1 reply; 27+ messages in thread
From: Nick Roberts @ 2008-03-14  0:21 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: riepel, emacs-pretest-bug, eliz, rms

Dan Nicolaescu writes:
 > Richard Stallman <rms@gnu.org> writes:
 > 
 >   >     We can actually completely get rid of `font-lock-comment-delimiter-face'
 >   >     if the color for the dark background, 8 colors is changed to "yellow".
 >   >     "yellow" is very readable on a black background. It will appear as
 >   >     orange on the Linux console, which is also very readable.
 >   > 
 >   > I tried that in `font-lock-comment-face', and it is ok, 
 > 
 > In that case, please let's go with that solution, it is the lower
 > complexity solution, and less surprising for the user.  We have gotten a
 > few bug reports from users that were confused by this (it is not
 > immediately intuitive).

I feel that you're using journalistic techniques to steam roller through your
wishes.  Let's look at the full quote:

       I tried that in `font-lock-comment-face', and it is ok, but having the
       text in white is clearer and easier to read.

I think it conveys quite a different impression.

All these stylistic changes that you are making are probably not worth arguing
about but I think you should look for some real agreement that they are an
improvement before making them.

-- 
Nick                                           http://www.inet.net.nz/~nickrob




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

* Re: incomplete comment colorization in terminals
  2008-03-14  0:21               ` Nick Roberts
@ 2008-03-14  0:34                 ` Dan Nicolaescu
  2008-03-15  4:46                   ` Nick Roberts
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-14  0:34 UTC (permalink / raw)
  To: Nick Roberts; +Cc: riepel, emacs-pretest-bug, eliz, rms

Nick Roberts <nickrob@snap.net.nz> writes:

  > Dan Nicolaescu writes:
  >  > Richard Stallman <rms@gnu.org> writes:
  >  > 
  >  >   >     We can actually completely get rid of `font-lock-comment-delimiter-face'
  >  >   >     if the color for the dark background, 8 colors is changed to "yellow".
  >  >   >     "yellow" is very readable on a black background. It will appear as
  >  >   >     orange on the Linux console, which is also very readable.
  >  >   > 
  >  >   > I tried that in `font-lock-comment-face', and it is ok, 
  >  > 
  >  > In that case, please let's go with that solution, it is the lower
  >  > complexity solution, and less surprising for the user.  We have gotten a
  >  > few bug reports from users that were confused by this (it is not
  >  > immediately intuitive).
  > 
  > I feel that you're using journalistic techniques to steam roller through your
  > wishes.  Let's look at the full quote:
  > 
  >        I tried that in `font-lock-comment-face', and it is ok, but having the
  >        text in white is clearer and easier to read.
  > 
  > I think it conveys quite a different impression.
  > 
  > All these stylistic changes that you are making are probably not worth arguing
  > about but I think you should look for some real agreement that they are an
  > improvement before making them.

Do you have a point here? It's unclear what you are trying to say.




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

* Re: incomplete comment colorization in terminals
  2008-03-13 18:55         ` Glenn Morris
  2008-03-13 21:52           ` Dan Nicolaescu
@ 2008-03-14  4:16           ` Dan Nicolaescu
  2008-03-14 15:08             ` Stefan Monnier
  1 sibling, 1 reply; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-14  4:16 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Rob Riepel, emacs-pretest-bug, Stefan Monnier

Glenn Morris <rgm@gnu.org> writes:

  > Stefan Monnier wrote:
  > 
  > >> Should we add a new entry for emacs-22.2 to correct these issues?
  > >
  > > Yes, please.
  > 
  > I already did.

Wouldn't it be better if the new text you added be in the 22.2 section?
It's not very likely that 22.1 users would read pass the 22.2 section.
Just add a note that this has been present in 22.1 too.




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

* Re: incomplete comment colorization in terminals
  2008-03-14  4:16           ` Dan Nicolaescu
@ 2008-03-14 15:08             ` Stefan Monnier
  0 siblings, 0 replies; 27+ messages in thread
From: Stefan Monnier @ 2008-03-14 15:08 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Rob Riepel, Glenn Morris, emacs-pretest-bug

>> >> Should we add a new entry for emacs-22.2 to correct these issues?
>> >
>> > Yes, please.
>> 
>> I already did.

> Wouldn't it be better if the new text you added be in the 22.2 section?
> It's not very likely that 22.1 users would read pass the 22.2 section.
> Just add a note that this has been present in 22.1 too.

Exactly,


        Stefan




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

* Re: incomplete comment colorization in terminals
  2008-03-12  4:26 ` Eli Zaretskii
  2008-03-12  6:44   ` Dan Nicolaescu
@ 2008-03-15  0:49   ` Rob Riepel
  2008-03-15 14:34     ` Eli Zaretskii
  1 sibling, 1 reply; 27+ messages in thread
From: Rob Riepel @ 2008-03-15  0:49 UTC (permalink / raw)
  To: Eli Zaretskii, Dan Nicolaescu; +Cc: emacs-pretest-bug

On Mar 11, 2008, at 9:26 PM, Eli Zaretskii wrote:

>> From: Rob Riepel <riepel@networking.stanford.edu>
>> Date: Tue, 11 Mar 2008 16:15:14 -0700 (PDT)
>>
>> When using font-locking in a terminal window (xterm and the like)  
>> single-line comments are only highlighted to the first non-space  
>> character after a space.  This happens in more than one language- 
>> specific mode - I've tried Emacs-lisp and CPerl modes.
>>
>> The bug does not occur when running Emacs under X, only in a  
>> terminal, and only for certain terminal types.  The bug is present  
>> when TERM is
>> set to xterm or xterm-color, but not when TERM is set to  
>> xterm-16color.
>
> This is not a bug, but a deliberate feature.  There's a new face  
> named font-lock-comment-delimiter-face.


And On Mar 11, 2008, at 9:45 PM, Dan Nicolaescu wrote:

> A good way to avoid this, and the recommended way run emacs in a  
> terminal emulator, is to set TERM to xterm-256color.  All current  
> xterm compatible terminal emulators support 256 colors, when using  
> that your colors will look almost the same in the terminal as the  
> do in X.


Thank you, Eli and Dan, for educating me.  I thought I had read NEWS,  
but apparently not.  :-(

Many of the debian systems I work on lack the ncurses-term package,  
so I often cannot set TERM to xterm-256color or even xterm-16color.   
So even though the terminals I use support 16 or more colors I'm  
often limited to xterm-color (from the debian ncurses-base package).   
So I've resorted to this:

   (and
    (boundp 'font-lock-comment-delimiter-face)
    (set-face-attribute 'font-lock-comment-face t :inherit
                        font-lock-comment-delimiter-face))

I really like the color schemes that come with 16+ color support, but  
there's no "mode" value for --color=mode that sets anything above 8.   
Is there a way to set the number of colors that can be displayed  
in .emacs?

--
Rob Riepel
(650) 725-7577
http://geek.stanford.edu






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

* Re: incomplete comment colorization in terminals
  2008-03-12 13:57   ` Stefan Monnier
  2008-03-13  6:40     ` Dan Nicolaescu
@ 2008-03-15  0:50     ` Rob Riepel
  1 sibling, 0 replies; 27+ messages in thread
From: Rob Riepel @ 2008-03-15  0:50 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-pretest-bug, Dan Nicolaescu

On Mar 12, 2008, at 6:57 AM, Stefan Monnier wrote:

> The NEWS entry for f in Emacs-22 is insufficient I believe.  It  
> should explain the effect of the introduction of this new face and  
> should point to xterm-256color as well as other methods to recover  
> the previous behavior.

The new entry looks great.  You may want to mention font-lock-comment- 
delimiter-face in the font-lock-mode documentation.  Right now it says:

| When Font Lock mode is enabled, text is fontified as you type it:
|
|  - Comments are displayed in `font-lock-comment-face';
|  - Strings are displayed in `font-lock-string-face';

Which could be slightly confusing to those who don't know that the  
delimiter is not part of the comment (at least as far as  
fontification is concerned).

--
Rob Riepel
(650) 725-7577
http://geek.stanford.edu






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

* Re: incomplete comment colorization in terminals
  2008-03-14  0:34                 ` Dan Nicolaescu
@ 2008-03-15  4:46                   ` Nick Roberts
  2008-03-15  8:34                     ` Dan Nicolaescu
  0 siblings, 1 reply; 27+ messages in thread
From: Nick Roberts @ 2008-03-15  4:46 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: riepel, emacs-pretest-bug, eliz, rms

 >   >  >   > I tried that in `font-lock-comment-face', and it is ok, 
 >   >  > 
 >   >  > In that case, please let's go with that solution, it is the lower
 >   >  > complexity solution, and less surprising for the user.  We have
 >   >  > gotten a few bug reports from users that were confused by this (it is
 >   >  > not immediately intuitive).
 >   > 
 >   > I feel that you're using journalistic techniques to steam roller through
 >   > your wishes.  Let's look at the full quote:
 >   > 
 >   >        I tried that in `font-lock-comment-face', and it is ok, but
 >   >        having the text in white is clearer and easier to read.
 >   > 
 >   > I think it conveys quite a different impression.
 >   > 
 >   > All these stylistic changes that you are making are probably not worth
 >   > arguing about but I think you should look for some real agreement that
 >   > they are an improvement before making them.
 > 
 > Do you have a point here? It's unclear what you are trying to say.

I just think that you are only listening to the parts that you want to
hear.  Maybe that's why my message is unclear to you.

-- 
Nick                                           http://www.inet.net.nz/~nickrob




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

* Re: incomplete comment colorization in terminals
  2008-03-15  4:46                   ` Nick Roberts
@ 2008-03-15  8:34                     ` Dan Nicolaescu
  0 siblings, 0 replies; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-15  8:34 UTC (permalink / raw)
  To: Nick Roberts; +Cc: riepel, emacs-pretest-bug, eliz, rms

Nick Roberts <nickrob@snap.net.nz> writes:

  >  >   >  >   > I tried that in `font-lock-comment-face', and it is ok, 
  >  >   >  > 
  >  >   >  > In that case, please let's go with that solution, it is the lower
  >  >   >  > complexity solution, and less surprising for the user.  We have
  >  >   >  > gotten a few bug reports from users that were confused by this (it is
  >  >   >  > not immediately intuitive).
  >  >   > 
  >  >   > I feel that you're using journalistic techniques to steam roller through
  >  >   > your wishes.  Let's look at the full quote:
  >  >   > 
  >  >   >        I tried that in `font-lock-comment-face', and it is ok, but
  >  >   >        having the text in white is clearer and easier to read.
  >  >   > 
  >  >   > I think it conveys quite a different impression.
  >  >   > 
  >  >   > All these stylistic changes that you are making are probably not worth
  >  >   > arguing about but I think you should look for some real agreement that
  >  >   > they are an improvement before making them.
  >  > 
  >  > Do you have a point here? It's unclear what you are trying to say.
  > 
  > I just think that you are only listening to the parts that you want to
  > hear.  Maybe that's why my message is unclear to you.

OK, I wanted to make sure that you were not trying to make a technical
point, just to attack.

Your behavior is out of line, please keep it off the list and out of my
mailbox too.

Yes, it is customary not quote too much when replying to a message.  In
this case the issue is not that complicated to not remember the whole
context, and don't worry RMS understands perfectly what it is.  And I
hope he gets what I am trying to say too.  We were just having a
technical discussion, as we've have many in the past.
Not sure what exactly you are trying to obtain here, but doing it this
way is not the best.




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

* Re: incomplete comment colorization in terminals
  2008-03-15  0:49   ` Rob Riepel
@ 2008-03-15 14:34     ` Eli Zaretskii
  0 siblings, 0 replies; 27+ messages in thread
From: Eli Zaretskii @ 2008-03-15 14:34 UTC (permalink / raw)
  To: Rob Riepel; +Cc: emacs-pretest-bug, dann

> Cc: emacs-pretest-bug@gnu.org
> From: Rob Riepel <riepel@networking.stanford.edu>
> Date: Fri, 14 Mar 2008 17:49:59 -0700
> 
> I really like the color schemes that come with 16+ color support, but  
> there's no "mode" value for --color=mode that sets anything above 8.   
> Is there a way to set the number of colors that can be displayed  
> in .emacs?

I'm guessing that you are reading the output of "emacs --help", which
is necessarily terse and doesn't tell the whole story.  In the Emacs
manual, by contrast, you will find this text:

    `--color=MODE'
	 For a character terminal only, specify the mode of color support.
	 This option is intended for overriding the number of supported
	 colors that the character terminal advertises in its `termcap' or
	 `terminfo' database.  The parameter MODE can be one of the
	 following:

	 ...

	`NUM'
	      Use color mode for NUM colors.  If NUM is -1, turn off color
	      support (equivalent to `never'); if it is 0, use the default
	      color support for this terminal (equivalent to `auto');
	      otherwise use an appropriate standard mode for NUM colors.
	      Depending on your terminal's capabilities, Emacs might be
	      able to turn on a color mode for 8, 16, 88, or 256 as the
	      value of NUM.  If there is no mode that supports NUM colors,
	      Emacs acts as if NUM were 0, i.e. it uses the terminal's
	      default color support mode.
	      If MODE is omitted, it defaults to ANSI8.

Thus, --color=16 should do what you want, if the terminal can support
16-color mode.




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

* Re: incomplete comment colorization in terminals
  2008-03-13 15:01       ` Stefan Monnier
  2008-03-13 18:55         ` Glenn Morris
@ 2008-03-19  4:02         ` Dan Nicolaescu
  1 sibling, 0 replies; 27+ messages in thread
From: Dan Nicolaescu @ 2008-03-19  4:02 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-pretest-bug

Stefan Monnier <monnier@iro.umontreal.ca> writes:

  > >> >> When using font-locking in a terminal window (xterm and the like)
  > >> >> single-line comments are only highlighted to the first non-space
  > >> >> character after a space.  This happens in more than one language-
  > >> >> specific mode - I've tried Emacs-lisp and CPerl modes.
  > >> >> 
  > >> >> The bug does not occur when running Emacs under X, only in a terminal,
  > >> >> and only for certain terminal types.  The bug is present when TERM is
  > >> >> set to xterm or xterm-color, but not when TERM is set to xterm-16color.
  > >> 
  > >> > A good way to avoid this, and the recommended way run emacs in a
  > >> > terminal emulator, is to set TERM to xterm-256color.  All current
  > >> > xterm compatible terminal emulators support 256 colors, when using that
  > >> > your colors will look almost the same in the terminal as the do in X.
  > >> 
  > >> The NEWS entry for font-lock-comment-delimiter-face in Emacs-22 is
  > >> insufficient I believe.  It should explain the effect of the
  > >> introduction of this new face and should point to xterm-256color as well
  > >> as other methods to recover the previous behavior.
  > 
  > > Should we add a new entry for emacs-22.2 to correct these issues?
  > 
  > Yes, please.
  > 
  > > It might be too close to the release, but maybe we could apply the
  > > change for the light background case?
  > 
  > If noone objects, it's fine by me.

Yidong also approved the change, so I checked it in 22.2.




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

end of thread, other threads:[~2008-03-19  4:02 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-11 23:15 incomplete comment colorization in terminals Rob Riepel
2008-03-12  4:26 ` Eli Zaretskii
2008-03-12  6:44   ` Dan Nicolaescu
2008-03-12  8:17     ` Nick Roberts
2008-03-12 13:54       ` Stefan Monnier
2008-03-12 15:07         ` Dan Nicolaescu
2008-03-12 17:51       ` Richard Stallman
2008-03-13  6:38         ` Dan Nicolaescu
2008-03-13 22:24           ` Richard Stallman
2008-03-13 22:44             ` Dan Nicolaescu
2008-03-14  0:21               ` Nick Roberts
2008-03-14  0:34                 ` Dan Nicolaescu
2008-03-15  4:46                   ` Nick Roberts
2008-03-15  8:34                     ` Dan Nicolaescu
2008-03-15  0:49   ` Rob Riepel
2008-03-15 14:34     ` Eli Zaretskii
2008-03-12  4:45 ` Dan Nicolaescu
2008-03-12 13:57   ` Stefan Monnier
2008-03-13  6:40     ` Dan Nicolaescu
2008-03-13 15:01       ` Stefan Monnier
2008-03-13 18:55         ` Glenn Morris
2008-03-13 21:52           ` Dan Nicolaescu
2008-03-14  4:16           ` Dan Nicolaescu
2008-03-14 15:08             ` Stefan Monnier
2008-03-19  4:02         ` Dan Nicolaescu
2008-03-15  0:50     ` Rob Riepel
2008-03-12 13:10 ` Stefan Monnier

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