Allow glyphless-char-display to distinguish between X and text terminals.

Use this for Tabulated List mode.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode): Use a custom
glyphless-char-display table.
(tabulated-list-glyphless-char-display): New var.

* src/term.c (produce_glyphless_glyph): Handle cons cell entry in
glyphless-char-display.

* src/xdisp.c (lookup_glyphless_char_display)
(produce_glyphless_glyph): Handle cons cell entry in
glyphless-char-display.
(Vglyphless_char_display): Document it.
This commit is contained in:
Chong Yidong 2011-04-18 19:21:31 -04:00
parent 8d6d9c8f8d
commit 16a43933e8
6 changed files with 62 additions and 14 deletions

View file

@ -143,6 +143,15 @@ If ADVANCE is non-nil, move forward by one line afterwards."
map)
"Local keymap for `tabulated-list-mode' sort buttons.")
(defvar tabulated-list-glyphless-char-display
(let ((table (make-char-table 'glyphless-char-display nil)))
(set-char-table-parent table glyphless-char-display)
;; Some text terminals can't display the unicode arrows; be safe.
(aset table 9650 (cons nil "^"))
(aset table 9660 (cons nil "v"))
table)
"The `glyphless-char-display' table in Tabulated List buffers.")
(defun tabulated-list-init-header ()
"Set up header line for the Tabulated List buffer."
(let ((x tabulated-list-padding)
@ -341,7 +350,9 @@ as the ewoc pretty-printer."
(setq truncate-lines t)
(setq buffer-read-only t)
(set (make-local-variable 'revert-buffer-function)
'tabulated-list-revert))
'tabulated-list-revert)
(set (make-local-variable 'glyphless-char-display)
tabulated-list-glyphless-char-display))
(put 'tabulated-list-mode 'mode-class 'special)