diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/term.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 44 |
3 files changed, 42 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 22e85967b82..40174020bf4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-04-18 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * xdisp.c (lookup_glyphless_char_display) | ||
| 4 | (produce_glyphless_glyph): Handle cons cell entry in | ||
| 5 | glyphless-char-display. | ||
| 6 | (Vglyphless_char_display): Document it. | ||
| 7 | |||
| 8 | * term.c (produce_glyphless_glyph): Handle cons cell entry in | ||
| 9 | glyphless-char-display. | ||
| 10 | |||
| 1 | 2011-04-17 Chong Yidong <cyd@stupidchicken.com> | 11 | 2011-04-17 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 12 | ||
| 3 | * xdisp.c (get_next_display_element): Remove unnecessary ifdefs. | 13 | * xdisp.c (get_next_display_element): Remove unnecessary ifdefs. |
diff --git a/src/term.c b/src/term.c index df13d7c0db2..cae83f4d269 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -1936,6 +1936,8 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) | |||
| 1936 | { | 1936 | { |
| 1937 | if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display)) | 1937 | if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display)) |
| 1938 | acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c); | 1938 | acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c); |
| 1939 | if (CONSP (acronym)) | ||
| 1940 | acronym = XCDR (acronym); | ||
| 1939 | buf[0] = '['; | 1941 | buf[0] = '['; |
| 1940 | str = STRINGP (acronym) ? SSDATA (acronym) : ""; | 1942 | str = STRINGP (acronym) ? SSDATA (acronym) : ""; |
| 1941 | for (len = 0; len < 6 && str[len] && ASCII_BYTE_P (str[len]); len++) | 1943 | for (len = 0; len < 6 && str[len] && ASCII_BYTE_P (str[len]); len++) |
diff --git a/src/xdisp.c b/src/xdisp.c index eaab8dac18d..574c84fc086 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5540,9 +5540,19 @@ lookup_glyphless_char_display (int c, struct it *it) | |||
| 5540 | 5540 | ||
| 5541 | if (CHAR_TABLE_P (Vglyphless_char_display) | 5541 | if (CHAR_TABLE_P (Vglyphless_char_display) |
| 5542 | && CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (Vglyphless_char_display)) >= 1) | 5542 | && CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (Vglyphless_char_display)) >= 1) |
| 5543 | glyphless_method = (c >= 0 | 5543 | { |
| 5544 | ? CHAR_TABLE_REF (Vglyphless_char_display, c) | 5544 | if (c >= 0) |
| 5545 | : XCHAR_TABLE (Vglyphless_char_display)->extras[0]); | 5545 | { |
| 5546 | glyphless_method = CHAR_TABLE_REF (Vglyphless_char_display, c); | ||
| 5547 | if (CONSP (glyphless_method)) | ||
| 5548 | glyphless_method = FRAME_WINDOW_P (it->f) | ||
| 5549 | ? XCAR (glyphless_method) | ||
| 5550 | : XCDR (glyphless_method); | ||
| 5551 | } | ||
| 5552 | else | ||
| 5553 | glyphless_method = XCHAR_TABLE (Vglyphless_char_display)->extras[0]; | ||
| 5554 | } | ||
| 5555 | |||
| 5546 | retry: | 5556 | retry: |
| 5547 | if (NILP (glyphless_method)) | 5557 | if (NILP (glyphless_method)) |
| 5548 | { | 5558 | { |
| @@ -22315,6 +22325,8 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) | |||
| 22315 | { | 22325 | { |
| 22316 | if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display)) | 22326 | if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display)) |
| 22317 | acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c); | 22327 | acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c); |
| 22328 | if (CONSP (acronym)) | ||
| 22329 | acronym = XCAR (acronym); | ||
| 22318 | str = STRINGP (acronym) ? SSDATA (acronym) : ""; | 22330 | str = STRINGP (acronym) ? SSDATA (acronym) : ""; |
| 22319 | } | 22331 | } |
| 22320 | else | 22332 | else |
| @@ -26950,17 +26962,21 @@ cursor shapes. */); | |||
| 26950 | Fput (Qglyphless_char_display, Qchar_table_extra_slots, make_number (1)); | 26962 | Fput (Qglyphless_char_display, Qchar_table_extra_slots, make_number (1)); |
| 26951 | 26963 | ||
| 26952 | DEFVAR_LISP ("glyphless-char-display", Vglyphless_char_display, | 26964 | DEFVAR_LISP ("glyphless-char-display", Vglyphless_char_display, |
| 26953 | doc: /* Char-table to control displaying of glyphless characters. | 26965 | doc: /* Char-table defining glyphless characters. |
| 26954 | Each element, if non-nil, is an ASCII acronym string (displayed in a box) | 26966 | Each element, if non-nil, should be one of the following: |
| 26955 | or one of these symbols: | 26967 | an ASCII acronym string: display this string in a box |
| 26956 | hex-code: display the hexadecimal code of a character in a box | 26968 | `hex-code': display the hexadecimal code of a character in a box |
| 26957 | empty-box: display as an empty box | 26969 | `empty-box': display as an empty box |
| 26958 | thin-space: display as 1-pixel width space | 26970 | `thin-space': display as 1-pixel width space |
| 26959 | zero-width: don't display | 26971 | `zero-width': don't display |
| 26960 | 26972 | An element may also be a cons cell (GRAPHICAL . TEXT), which specifies the | |
| 26961 | It has one extra slot to control the display of a character for which | 26973 | display method for graphical terminals and text terminals respectively. |
| 26962 | no font is found. The value of the slot is `hex-code' or `empty-box'. | 26974 | GRAPHICAL and TEXT should each have one of the values listed above. |
| 26963 | The default is `empty-box'. */); | 26975 | |
| 26976 | The char-table has one extra slot to control the display of a character for | ||
| 26977 | which no font is found. This slot only takes effect on graphical terminals. | ||
| 26978 | Its value should be an ASCII acronym string, `hex-code', `empty-box', or | ||
| 26979 | `thin-space'. The default is `empty-box'. */); | ||
| 26964 | Vglyphless_char_display = Fmake_char_table (Qglyphless_char_display, Qnil); | 26980 | Vglyphless_char_display = Fmake_char_table (Qglyphless_char_display, Qnil); |
| 26965 | Fset_char_table_extra_slot (Vglyphless_char_display, make_number (0), | 26981 | Fset_char_table_extra_slot (Vglyphless_char_display, make_number (0), |
| 26966 | Qempty_box); | 26982 | Qempty_box); |