emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: obscure new display features


From: Juri Linkov
Subject: Re: obscure new display features
Date: Mon, 28 Mar 2005 02:59:33 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)

> I find the new display features concerning `escape-glyph' and
> `show-nonbreak-escape' annoying, but also they're obscure and partly
> inconsistent.  This is roughly what I went through on encountering
> them.
>
> First you wonder why, say, ^L in your source files is apparently being
> font-locked as a keyword.

I agree.  ^L fontified as a keyword looks horrible.  That's why I suggested
to change its color to "dark red" to look more like comments.

> You use C-u C-x =, and there's no clue -- no face property or
> display table entry.  You then look for an overlay with no joy.
> Huh?  Surely something like this should be done with
> a display table.

Using a display table would be a cleaner solution.  Also it would
allow to add more highlighted elements like ellipsis.  But using
a display table means that this feature will be turned off by
default to not create a display table at startup.

Ideally, this feature should be activated by a minor mode or
a variable to easily turn it on/off on a per-buffer basis
(like `whitespace-global-mode' or `show-trailing-whitespace').

> The situation is similar for `show-nonbreak-escape'.  Actually that's
> more annoying since it changes the display and layout of things likely
> actually to use NBSP for layout.  It's also inconsistent and partly
> incorrect.

It should be disabled in buffers where it is used for its primary purpose.

In other buffers I think that instead of adding escape character
it's better to highlight NBSP in `trailing-whitespace' face because
it serves the same purpose to turn user's attention to potentially
dangerous whitespace characters.

> I've no idea why non-breaking characters should be displayed like
> this, but U+00AD isn't one -- it's SOFT HYPHEN.  If you're going to
> change its display, the issue (see Unicode) is whether or not it
> should be displayed at all -- not that I think it should be
> invisible.

I guess it should be visible at the end of the line.

> NON-BREAKING HYPHEN is U+2011.

Yes, this should be added too.

> The inconsistency is that non-breaking space is at codepoint 32 in
> at least all the iso8859 Emacs charsets, but apparently only the
> 8859-1 version is treated.

I don't know what is the cleanest way to check it in all charsets,
perhaps the following code will work:

(eq (aref (get 'utf-translation-table-for-encode 'translation-table) ? ) ?\x8a0)
(eq (aref (get 'utf-translation-table-for-encode 'translation-table) ?­) ?\x8ad)

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]