Next: , Up: Display Tables   [Contents][Index]


52.11.1 Display Table Format

A display table is an array of 256 elements. In FSF Emacs, a display table is 262 elements. The six extra elements specify the truncation and continuation glyphs, etc. This method is very kludgey, and in SXEmacs the variables truncation-glyph, continuation-glyph, etc. are used. See Truncation.

Function: make-display-table

This creates and returns a display table. The table initially has nil in all elements.

The 256 elements correspond to character codes; the nth element says how to display the character code n. The value should be nil, a string, a glyph, or a vector of strings and glyphs (see Character Descriptors). If an element is nil, it says to display that character according to the usual display conventions (see Usual Display).

If you use the display table to change the display of newline characters, the whole buffer will be displayed as one long “line.”

For example, here is how to construct a display table that mimics the effect of setting ctl-arrow to a non-nil value:

(setq disptab (make-display-table))
(let ((i 0))
  (while (< i 32)
    (or (= i ?\t) (= i ?\n)
        (aset disptab i (concat "^" (char-to-string (+ i 64)))))
    (setq i (1+ i)))
  (aset disptab 127 "^?"))