Commit 9694740b authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(get_next_display_element): Use an enum in last change.

parent 748e3d67
2009-09-28 Stefan Monnier <monnier@iro.umontreal.ca>
* xdisp.c (get_next_display_element): Use an enum in last change.
2009-09-28 Kenichi Handa <handa@m17n.org> 2009-09-28 Kenichi Handa <handa@m17n.org>
   
* xdisp.c: Pay attention to * xdisp.c (get_next_display_element): Pay attention to
unibyte_display_via_language_environment in handling unibyte_display_via_language_environment in handling
Vnobreak_char_display. Vnobreak_char_display.
   
...@@ -19,8 +23,8 @@ ...@@ -19,8 +23,8 @@
(ns_set_name_as_filename, x-create-frame, ns-get-resource) (ns_set_name_as_filename, x-create-frame, ns-get-resource)
(ns-set-resource): Use ns_app_name instead of NSProcessInfo call. (ns-set-resource): Use ns_app_name instead of NSProcessInfo call.
   
* menu.c (find_and_return_menu_selection) [HAVE_NS]: Remove * menu.c (find_and_return_menu_selection) [HAVE_NS]:
double-casting in client_data comparison. Remove double-casting in client_data comparison.
   
2009-09-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 2009-09-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
   
......
...@@ -5684,9 +5684,8 @@ get_next_display_element (it) ...@@ -5684,9 +5684,8 @@ get_next_display_element (it)
{ {
Lisp_Object dv; Lisp_Object dv;
struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte); struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte);
int nbsp_or_shy = 0; /* 1:NO-BREAK SPACE, 2:SOFT HYPHEN, 0:ELSE */ enum { char_is_other = 0, char_is_nbsp, char_is_soft_hyphen }
#define IS_NBSP (nbsp_or_shy == 1) nbsp_or_shy = char_is_other;
#define IS_SHY (nbsp_or_shy == 2)
int decoded = it->c; int decoded = it->c;
   
if (it->dp if (it->dp
...@@ -5723,9 +5722,13 @@ get_next_display_element (it) ...@@ -5723,9 +5722,13 @@ get_next_display_element (it)
if (it->c >= 0x80 && ! NILP (Vnobreak_char_display)) if (it->c >= 0x80 && ! NILP (Vnobreak_char_display))
{ {
if (it->multibyte_p) if (it->multibyte_p)
nbsp_or_shy = it->c == 0xA0 ? 1 : it->c == 0xAD ? 2 : 0; nbsp_or_shy = (it->c == 0xA0 ? char_is_nbsp
: it->c == 0xAD ? char_is_soft_hyphen
: char_is_other);
else if (unibyte_display_via_language_environment) else if (unibyte_display_via_language_environment)
nbsp_or_shy = decoded == 0xA0 ? 1 : decoded == 0xAD ? 2 : 0; nbsp_or_shy = (decoded == 0xA0 ? char_is_nbsp
: decoded == 0xAD ? char_is_soft_hyphen
: char_is_other);
} }
   
/* Translate control characters into `\003' or `^C' form. /* Translate control characters into `\003' or `^C' form.
...@@ -5808,7 +5811,7 @@ get_next_display_element (it) ...@@ -5808,7 +5811,7 @@ get_next_display_element (it)
highlighting. */ highlighting. */
   
if (EQ (Vnobreak_char_display, Qt) if (EQ (Vnobreak_char_display, Qt)
&& IS_NBSP) && nbsp_or_shy == char_is_nbsp)
{ {
/* Merge the no-break-space face into the current face. */ /* Merge the no-break-space face into the current face. */
face_id = merge_faces (it->f, Qnobreak_space, 0, face_id = merge_faces (it->f, Qnobreak_space, 0,
...@@ -5858,7 +5861,7 @@ get_next_display_element (it) ...@@ -5858,7 +5861,7 @@ get_next_display_element (it)
highlighting. */ highlighting. */
   
if (EQ (Vnobreak_char_display, Qt) if (EQ (Vnobreak_char_display, Qt)
&& IS_SHY) && nbsp_or_shy == char_is_soft_hyphen)
{ {
it->c = '-'; it->c = '-';
XSETINT (it->ctl_chars[0], '-'); XSETINT (it->ctl_chars[0], '-');
...@@ -5872,7 +5875,7 @@ get_next_display_element (it) ...@@ -5872,7 +5875,7 @@ get_next_display_element (it)
if (nbsp_or_shy) if (nbsp_or_shy)
{ {
XSETINT (it->ctl_chars[0], escape_glyph); XSETINT (it->ctl_chars[0], escape_glyph);
it->c = (IS_NBSP ? ' ' : '-'); it->c = (nbsp_or_shy == char_is_nbsp ? ' ' : '-');
XSETINT (it->ctl_chars[1], it->c); XSETINT (it->ctl_chars[1], it->c);
ctl_len = 2; ctl_len = 2;
goto display_control; goto display_control;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment