comparison lisp/disp-table.el @ 4452:82f8351e71c8

Improve portable sample implementations for #'{put,get}-display-table 2008-05-11 Aidan Kehoe <kehoea@parhasard.net> * disp-table.el (make-display-table): Update the example code to make it more general, and more compatible with GNU.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 11 May 2008 11:20:24 +0200
parents e214ff9f9507
children 1f0aa40cafe0
comparison
equal deleted inserted replaced
4451:e214ff9f9507 4452:82f8351e71c8
46 `get-display-table' to examine what that character is currently displayed 46 `get-display-table' to examine what that character is currently displayed
47 as: 47 as:
48 48
49 \(defun-when-void put-display-table (range value display-table) 49 \(defun-when-void put-display-table (range value display-table)
50 \"Set the value for char RANGE to VALUE in DISPLAY-TABLE. \" 50 \"Set the value for char RANGE to VALUE in DISPLAY-TABLE. \"
51 (ecase (type-of display-table) 51 (if (sequencep display-table)
52 (vector 52 (aset display-table range value)
53 (aset display-table range value)) 53 (put-char-table range value display-table)))
54 (char-table
55 (put-char-table range value display-table))))
56 54
57 \(defun-when-void get-display-table (character display-table) 55 \(defun-when-void get-display-table (character display-table)
58 \"Find value for CHARACTER in DISPLAY-TABLE. \" 56 \"Find value for CHARACTER in DISPLAY-TABLE. \"
59 (ecase (type-of display-table) 57 (if (sequencep display-table)
60 (vector 58 (aref display-table character)
61 (aref display-table character)) 59 (get-char-table character display-table)))
62 (char-table
63 (get-char-table character display-table))))
64 60
65 In this implementation, `put-display-table' and `get-display-table' are 61 In this implementation, `put-display-table' and `get-display-table' are
66 aliases of `put-char-table' and `get-char-table' respectively, and are 62 aliases of `put-char-table' and `get-char-table' respectively, and are
67 always available. " 63 always available."
68 (make-char-table 'generic)) 64 (make-char-table 'generic))
69 65
70 ;;;###autoload 66 ;;;###autoload
71 (defalias 'put-display-table #'put-char-table) 67 (defalias 'put-display-table #'put-char-table)
72 68