emacs-devel
[Top][All Lists]
Advanced

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

Re: non-breaking hyphens


From: Juri Linkov
Subject: Re: non-breaking hyphens
Date: Wed, 19 Oct 2011 11:27:15 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (x86_64-pc-linux-gnu)

> The right way to implement this feature, as brought up in the 2004
> thread, would be to specify the affected characters with a char-table
> rather than hardcoding them.  But we should probably leave such a change
> till after 24.1.

Since glyphless characters (like "ZERO WIDTH NO-BREAK SPACE") are
displayed now using a char-table, it makes sense to display confusable
characters with a similar char-table (e.g. `confusable-char-display')
where display methods could specify how to display them (face, etc.)

BTW, there is already a mapping in lisp/international/latin1-disp.el
in `latin1-display-ucs-per-lynx' that can be used to match confusable
characters.

> In the meantime, I think I'll add non-breaking hyphen and hyphen to the
> hardcoded list, while deferring on the various other space characters;

While they are still hadrcoded, requires another change:

=== modified file 'lisp/descr-text.el'
--- lisp/descr-text.el  2011-09-29 00:12:44 +0000
+++ lisp/descr-text.el  2011-10-19 08:22:27 +0000
@@ -606,7 +606,8 @@ (defun describe-char (pos &optional buff
                              'trailing-whitespace)
                             ((and nobreak-char-display char (eq char '#xa0))
                              'nobreak-space)
-                            ((and nobreak-char-display char (eq char '#xad))
+                            ((and nobreak-char-display char
+                                 (memq char '(#xad #x2010 #x2011)))
                              'escape-glyph)
                             ((and (< char 32) (not (memq char '(9 10))))
                              'escape-glyph)))))




reply via email to

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