aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2009-09-28 01:05:20 +0000
committerKenichi Handa2009-09-28 01:05:20 +0000
commit748e162f10771f0482eaa29444a0d3e3ba738e98 (patch)
tree3899885f807537cb91b9a884fb2c2dbdf0d62e78
parent5f6c3a65accaf31327ee2a35b0faf300bf21c11f (diff)
downloademacs-748e162f10771f0482eaa29444a0d3e3ba738e98.tar.gz
emacs-748e162f10771f0482eaa29444a0d3e3ba738e98.zip
Pay attention to
unibyte_display_via_language_environment in handling Vnobreak_char_display.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xdisp.c52
2 files changed, 39 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index be55c6bc793..0daec9cff18 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12009-09-28 Kenichi Handa <handa@m17n.org>
2
3 * xdisp.c: Pay attention to
4 unibyte_display_via_language_environment in handling
5 Vnobreak_char_display.
6
12009-09-27 Adrian Robert <Adrian.B.Robert@gmail.com> 72009-09-27 Adrian Robert <Adrian.B.Robert@gmail.com>
2 8
3 * nsterm.h (ns_app_name): New extern variable. 9 * nsterm.h (ns_app_name): New extern variable.
diff --git a/src/xdisp.c b/src/xdisp.c
index 24945f82ebe..0f72a2bd7b6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5684,6 +5684,10 @@ 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 */
5688#define IS_NBSP (nbsp_or_shy == 1)
5689#define IS_SHY (nbsp_or_shy == 2)
5690 int decoded = it->c;
5687 5691
5688 if (it->dp 5692 if (it->dp
5689 && (dv = DISP_CHAR_VECTOR (it->dp, it->c), 5693 && (dv = DISP_CHAR_VECTOR (it->dp, it->c),
@@ -5712,6 +5716,18 @@ get_next_display_element (it)
5712 goto get_next; 5716 goto get_next;
5713 } 5717 }
5714 5718
5719 if (unibyte_display_via_language_environment
5720 && it->c >= 0x80)
5721 decoded = DECODE_CHAR (unibyte, it->c);
5722
5723 if (it->c >= 0x80 && ! NILP (Vnobreak_char_display))
5724 {
5725 if (it->multibyte_p)
5726 nbsp_or_shy = it->c == 0xA0 ? 1 : it->c == 0xAD ? 2 : 0;
5727 else if (unibyte_display_via_language_environment)
5728 nbsp_or_shy = decoded == 0xA0 ? 1 : decoded == 0xAD ? 2 : 0;
5729 }
5730
5715 /* Translate control characters into `\003' or `^C' form. 5731 /* Translate control characters into `\003' or `^C' form.
5716 Control characters coming from a display table entry are 5732 Control characters coming from a display table entry are
5717 currently not translated because we use IT->dpvec to hold 5733 currently not translated because we use IT->dpvec to hold
@@ -5724,21 +5740,19 @@ get_next_display_element (it)
5724 If it->multibyte_p is zero, eight-bit characters that 5740 If it->multibyte_p is zero, eight-bit characters that
5725 don't have corresponding multibyte char code are also 5741 don't have corresponding multibyte char code are also
5726 translated to octal form. */ 5742 translated to octal form. */
5727 else if ((it->c < ' ' 5743 if ((it->c < ' '
5728 ? (it->area != TEXT_AREA 5744 ? (it->area != TEXT_AREA
5729 /* In mode line, treat \n, \t like other crl chars. */ 5745 /* In mode line, treat \n, \t like other crl chars. */
5730 || (it->c != '\t' 5746 || (it->c != '\t'
5731 && it->glyph_row 5747 && it->glyph_row
5732 && (it->glyph_row->mode_line_p || it->avoid_cursor_p)) 5748 && (it->glyph_row->mode_line_p || it->avoid_cursor_p))
5733 || (it->c != '\n' && it->c != '\t')) 5749 || (it->c != '\n' && it->c != '\t'))
5734 : (it->multibyte_p 5750 : (nbsp_or_shy
5735 ? (!CHAR_PRINTABLE_P (it->c) 5751 || (it->multibyte_p
5736 || (!NILP (Vnobreak_char_display) 5752 ? ! CHAR_PRINTABLE_P (it->c)
5737 && (it->c == 0xA0 /* NO-BREAK SPACE */ 5753 : (! unibyte_display_via_language_environment
5738 || it->c == 0xAD /* SOFT HYPHEN */))) 5754 ? it->c >= 0x80
5739 : (it->c >= 127 5755 : (decoded >= 0x80 && decoded < 0xA0))))))
5740 && (! unibyte_display_via_language_environment
5741 || (DECODE_CHAR (unibyte, it->c) <= 0xA0))))))
5742 { 5756 {
5743 /* IT->c is a control character which must be displayed 5757 /* IT->c is a control character which must be displayed
5744 either as '\003' or as `^C' where the '\\' and '^' 5758 either as '\003' or as `^C' where the '\\' and '^'
@@ -5794,7 +5808,7 @@ get_next_display_element (it)
5794 highlighting. */ 5808 highlighting. */
5795 5809
5796 if (EQ (Vnobreak_char_display, Qt) 5810 if (EQ (Vnobreak_char_display, Qt)
5797 && it->c == 0xA0) 5811 && IS_NBSP)
5798 { 5812 {
5799 /* Merge the no-break-space face into the current face. */ 5813 /* Merge the no-break-space face into the current face. */
5800 face_id = merge_faces (it->f, Qnobreak_space, 0, 5814 face_id = merge_faces (it->f, Qnobreak_space, 0,
@@ -5844,7 +5858,7 @@ get_next_display_element (it)
5844 highlighting. */ 5858 highlighting. */
5845 5859
5846 if (EQ (Vnobreak_char_display, Qt) 5860 if (EQ (Vnobreak_char_display, Qt)
5847 && it->c == 0xAD) 5861 && IS_SHY)
5848 { 5862 {
5849 it->c = '-'; 5863 it->c = '-';
5850 XSETINT (it->ctl_chars[0], '-'); 5864 XSETINT (it->ctl_chars[0], '-');
@@ -5855,10 +5869,10 @@ get_next_display_element (it)
5855 /* Handle non-break space and soft hyphen 5869 /* Handle non-break space and soft hyphen
5856 with the escape glyph. */ 5870 with the escape glyph. */
5857 5871
5858 if (it->c == 0xA0 || it->c == 0xAD) 5872 if (nbsp_or_shy)
5859 { 5873 {
5860 XSETINT (it->ctl_chars[0], escape_glyph); 5874 XSETINT (it->ctl_chars[0], escape_glyph);
5861 it->c = (it->c == 0xA0 ? ' ' : '-'); 5875 it->c = (IS_NBSP ? ' ' : '-');
5862 XSETINT (it->ctl_chars[1], it->c); 5876 XSETINT (it->ctl_chars[1], it->c);
5863 ctl_len = 2; 5877 ctl_len = 2;
5864 goto display_control; 5878 goto display_control;