diff options
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 13 | ||||
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/term.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 44 |
6 files changed, 63 insertions, 15 deletions
| @@ -779,6 +779,9 @@ sc.el, x-menu.el, rnews.el, rnewspost.el | |||
| 779 | 779 | ||
| 780 | * Lisp changes in Emacs 24.1 | 780 | * Lisp changes in Emacs 24.1 |
| 781 | 781 | ||
| 782 | ** `glyphless-char-table' can now distinguish between graphical and | ||
| 783 | text terminal display, via a char-table entry that is a cons cell. | ||
| 784 | |||
| 782 | ** `open-network-stream' can now be used to open an encrypted stream. | 785 | ** `open-network-stream' can now be used to open an encrypted stream. |
| 783 | It now accepts an optional `:type' parameter for initiating a TLS | 786 | It now accepts an optional `:type' parameter for initiating a TLS |
| 784 | connection, directly or via STARTTLS. To do STARTTLS, additional | 787 | connection, directly or via STARTTLS. To do STARTTLS, additional |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 373ae63bfe5..2e024d34981 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-04-18 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * emacs-lisp/tabulated-list.el (tabulated-list-mode): Use a custom | ||
| 4 | glyphless-char-display table. | ||
| 5 | (tabulated-list-glyphless-char-display): New var. | ||
| 6 | |||
| 1 | 2011-04-18 Sam Steingold <sds@gnu.org> | 7 | 2011-04-18 Sam Steingold <sds@gnu.org> |
| 2 | 8 | ||
| 3 | * vc/add-log.el (change-log-font-lock-keywords): Add "Thanks to" | 9 | * vc/add-log.el (change-log-font-lock-keywords): Add "Thanks to" |
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 6409c2206bc..2fdfa9525b1 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el | |||
| @@ -143,6 +143,15 @@ If ADVANCE is non-nil, move forward by one line afterwards." | |||
| 143 | map) | 143 | map) |
| 144 | "Local keymap for `tabulated-list-mode' sort buttons.") | 144 | "Local keymap for `tabulated-list-mode' sort buttons.") |
| 145 | 145 | ||
| 146 | (defvar tabulated-list-glyphless-char-display | ||
| 147 | (let ((table (make-char-table 'glyphless-char-display nil))) | ||
| 148 | (set-char-table-parent table glyphless-char-display) | ||
| 149 | ;; Some text terminals can't display the unicode arrows; be safe. | ||
| 150 | (aset table 9650 (cons nil "^")) | ||
| 151 | (aset table 9660 (cons nil "v")) | ||
| 152 | table) | ||
| 153 | "The `glyphless-char-display' table in Tabulated List buffers.") | ||
| 154 | |||
| 146 | (defun tabulated-list-init-header () | 155 | (defun tabulated-list-init-header () |
| 147 | "Set up header line for the Tabulated List buffer." | 156 | "Set up header line for the Tabulated List buffer." |
| 148 | (let ((x tabulated-list-padding) | 157 | (let ((x tabulated-list-padding) |
| @@ -341,7 +350,9 @@ as the ewoc pretty-printer." | |||
| 341 | (setq truncate-lines t) | 350 | (setq truncate-lines t) |
| 342 | (setq buffer-read-only t) | 351 | (setq buffer-read-only t) |
| 343 | (set (make-local-variable 'revert-buffer-function) | 352 | (set (make-local-variable 'revert-buffer-function) |
| 344 | 'tabulated-list-revert)) | 353 | 'tabulated-list-revert) |
| 354 | (set (make-local-variable 'glyphless-char-display) | ||
| 355 | tabulated-list-glyphless-char-display)) | ||
| 345 | 356 | ||
| 346 | (put 'tabulated-list-mode 'mode-class 'special) | 357 | (put 'tabulated-list-mode 'mode-class 'special) |
| 347 | 358 | ||
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); |