diff 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
line wrap: on
line diff
--- a/lisp/disp-table.el	Mon Dec 24 20:22:08 2007 +0100
+++ b/lisp/disp-table.el	Sun May 11 11:20:24 2008 +0200
@@ -48,23 +48,19 @@
 
 \(defun-when-void put-display-table (range value display-table)
   \"Set the value for char RANGE to VALUE in DISPLAY-TABLE.  \"
-  (ecase (type-of display-table)
-    (vector
-     (aset display-table range value))
-    (char-table
-     (put-char-table range value display-table))))
+  (if (sequencep display-table)
+      (aset display-table range value)
+    (put-char-table range value display-table)))
 
 \(defun-when-void get-display-table (character display-table)
   \"Find value for CHARACTER in DISPLAY-TABLE.  \"
-  (ecase (type-of display-table)
-    (vector
-     (aref display-table character))
-    (char-table
-     (get-char-table character display-table))))
+  (if (sequencep display-table)
+      (aref display-table character)
+    (get-char-table character display-table)))
 
 In this implementation, `put-display-table' and `get-display-table' are
 aliases of `put-char-table' and `get-char-table' respectively, and are
-always available.   "
+always available."
   (make-char-table 'generic))
 
 ;;;###autoload