From 16a43933e891bae502efbe367e32608fcfffdec3 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 18 Apr 2011 19:21:31 -0400 Subject: 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. --- lisp/emacs-lisp/tabulated-list.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') 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." 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) -- cgit v1.2.3