carbon2-commit: Improve portable sample implementations for #'{put, get}-display-table

Aidan Kehoe aidan-guest at alioth.debian.org
Sat May 24 03:57:19 EDT 2008


changeset:   4478:82f8351e71c88a406868ece693e521789c8a7441
user:        Aidan Kehoe <kehoea at parhasard.net>
date:        Sun May 11 11:20:24 2008 +0200
files:       lisp/ChangeLog lisp/disp-table.el
description:
Improve portable sample implementations for #'{put,get}-display-table

2008-05-11  Aidan Kehoe  <kehoea at parhasard.net>

	* disp-table.el (make-display-table):
	Update the example code to make it more general, and more
	compatible with GNU.


diff -r e214ff9f9507794f61ad09d81e5f9272447c87d2 -r 82f8351e71c88a406868ece693e521789c8a7441 lisp/ChangeLog
--- a/lisp/ChangeLog	Mon Dec 24 20:22:08 2007 +0100
+++ b/lisp/ChangeLog	Sun May 11 11:20:24 2008 +0200
@@ -1,3 +1,9 @@ 2007-07-21  Aidan Kehoe  <kehoea at parhasa
+2008-05-11  Aidan Kehoe  <kehoea at parhasard.net>
+
+	* disp-table.el (make-display-table): 
+	Update the example code to make it more general, and more
+	compatible with GNU.
+
 2007-07-21  Aidan Kehoe  <kehoea at parhasard.net>
 
 	* mule/cyril-util.el:
diff -r e214ff9f9507794f61ad09d81e5f9272447c87d2 -r 82f8351e71c88a406868ece693e521789c8a7441 lisp/disp-table.el
--- 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 @@ as:
 
 \(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




More information about the XEmacs-Patches mailing list