aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog10
-rw-r--r--src/xdisp.c19
2 files changed, 18 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0daec9cff18..8aa3e7b691b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,10 @@
12009-09-28 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xdisp.c (get_next_display_element): Use an enum in last change.
4
12009-09-28 Kenichi Handa <handa@m17n.org> 52009-09-28 Kenichi Handa <handa@m17n.org>
2 6
3 * xdisp.c: Pay attention to 7 * xdisp.c (get_next_display_element): Pay attention to
4 unibyte_display_via_language_environment in handling 8 unibyte_display_via_language_environment in handling
5 Vnobreak_char_display. 9 Vnobreak_char_display.
6 10
@@ -19,8 +23,8 @@
19 (ns_set_name_as_filename, x-create-frame, ns-get-resource) 23 (ns_set_name_as_filename, x-create-frame, ns-get-resource)
20 (ns-set-resource): Use ns_app_name instead of NSProcessInfo call. 24 (ns-set-resource): Use ns_app_name instead of NSProcessInfo call.
21 25
22 * menu.c (find_and_return_menu_selection) [HAVE_NS]: Remove 26 * menu.c (find_and_return_menu_selection) [HAVE_NS]:
23 double-casting in client_data comparison. 27 Remove double-casting in client_data comparison.
24 28
252009-09-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 292009-09-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
26 30
diff --git a/src/xdisp.c b/src/xdisp.c
index 0f72a2bd7b6..226a43d7dc5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5684,9 +5684,8 @@ get_next_display_element (it)
5684 { 5684 {
5685 Lisp_Object dv; 5685 Lisp_Object dv;
5686 struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte); 5686 struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte);
5687 int nbsp_or_shy = 0; /* 1:NO-BREAK SPACE, 2:SOFT HYPHEN, 0:ELSE */ 5687 enum { char_is_other = 0, char_is_nbsp, char_is_soft_hyphen }
5688#define IS_NBSP (nbsp_or_shy == 1) 5688 nbsp_or_shy = char_is_other;
5689#define IS_SHY (nbsp_or_shy == 2)
5690 int decoded = it->c; 5689 int decoded = it->c;
5691 5690
5692 if (it->dp 5691 if (it->dp
@@ -5723,9 +5722,13 @@ get_next_display_element (it)
5723 if (it->c >= 0x80 && ! NILP (Vnobreak_char_display)) 5722 if (it->c >= 0x80 && ! NILP (Vnobreak_char_display))
5724 { 5723 {
5725 if (it->multibyte_p) 5724 if (it->multibyte_p)
5726 nbsp_or_shy = it->c == 0xA0 ? 1 : it->c == 0xAD ? 2 : 0; 5725 nbsp_or_shy = (it->c == 0xA0 ? char_is_nbsp
5726 : it->c == 0xAD ? char_is_soft_hyphen
5727 : char_is_other);
5727 else if (unibyte_display_via_language_environment) 5728 else if (unibyte_display_via_language_environment)
5728 nbsp_or_shy = decoded == 0xA0 ? 1 : decoded == 0xAD ? 2 : 0; 5729 nbsp_or_shy = (decoded == 0xA0 ? char_is_nbsp
5730 : decoded == 0xAD ? char_is_soft_hyphen
5731 : char_is_other);
5729 } 5732 }
5730 5733
5731 /* Translate control characters into `\003' or `^C' form. 5734 /* Translate control characters into `\003' or `^C' form.
@@ -5808,7 +5811,7 @@ get_next_display_element (it)
5808 highlighting. */ 5811 highlighting. */
5809 5812
5810 if (EQ (Vnobreak_char_display, Qt) 5813 if (EQ (Vnobreak_char_display, Qt)
5811 && IS_NBSP) 5814 && nbsp_or_shy == char_is_nbsp)
5812 { 5815 {
5813 /* Merge the no-break-space face into the current face. */ 5816 /* Merge the no-break-space face into the current face. */
5814 face_id = merge_faces (it->f, Qnobreak_space, 0, 5817 face_id = merge_faces (it->f, Qnobreak_space, 0,
@@ -5858,7 +5861,7 @@ get_next_display_element (it)
5858 highlighting. */ 5861 highlighting. */
5859 5862
5860 if (EQ (Vnobreak_char_display, Qt) 5863 if (EQ (Vnobreak_char_display, Qt)
5861 && IS_SHY) 5864 && nbsp_or_shy == char_is_soft_hyphen)
5862 { 5865 {
5863 it->c = '-'; 5866 it->c = '-';
5864 XSETINT (it->ctl_chars[0], '-'); 5867 XSETINT (it->ctl_chars[0], '-');
@@ -5872,7 +5875,7 @@ get_next_display_element (it)
5872 if (nbsp_or_shy) 5875 if (nbsp_or_shy)
5873 { 5876 {
5874 XSETINT (it->ctl_chars[0], escape_glyph); 5877 XSETINT (it->ctl_chars[0], escape_glyph);
5875 it->c = (IS_NBSP ? ' ' : '-'); 5878 it->c = (nbsp_or_shy == char_is_nbsp ? ' ' : '-');
5876 XSETINT (it->ctl_chars[1], it->c); 5879 XSETINT (it->ctl_chars[1], it->c);
5877 ctl_len = 2; 5880 ctl_len = 2;
5878 goto display_control; 5881 goto display_control;