changeset 24372:2f9d6ac5d426

(what-cursor-position): charset-origin-alist property of a coding system may be a translation table or a symbol of which `translation-table' property is a translation table.
author Kenichi Handa <handa@m17n.org>
date Mon, 22 Feb 1999 01:59:30 +0000
parents 766feaa457a9
children c9020001e3c5
files lisp/simple.el
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Mon Feb 22 01:59:01 1999 +0000
+++ b/lisp/simple.el	Mon Feb 22 01:59:30 1999 +0000
@@ -533,7 +533,20 @@
 		 (setq slot
 		       (coding-system-get coding-system 'charset-origin-alist))
 		 (setq slot (assq charset slot)))
-	    (setq external (list (nth 1 slot) (funcall (nth 2 slot) char))))
+	    (let ((encoder (nth 2 slot)))
+	      (setq external
+		    (list (nth 1 slot)
+			  (cond ((functionp encoder)
+				 (funcall encoder char))
+				((char-table-p encoder)
+				 (aref encoder char))
+				((and (symbolp encoder)
+				      (char-table-p
+				       (get encoder 'translation-table)))
+				 (aref (get encoder 'translation-table) char))
+				(t
+				 (error "Invalid property in %s"
+					coding-system)))))))
 	(setq encoding-msg
 	      (if external
 		  (format "(0%o, %d, 0x%x, ext 0x%x)"