# HG changeset patch # User Dave Love # Date 1008186931 0 # Node ID 8acbb96a91c36e4eaf730e341e9222a7d84f6b1f # Parent 21b646d266aae779daa5e22776728b9667bcf029 (make-translation-table-from-vector): Allow null elements in VEC. diff -r 21b646d266aa -r 8acbb96a91c3 lisp/international/mule.el --- a/lisp/international/mule.el Wed Dec 12 19:17:44 2001 +0000 +++ b/lisp/international/mule.el Wed Dec 12 19:55:31 2001 +0000 @@ -1,8 +1,8 @@ ;;; mule.el --- basic commands for mulitilingual environment ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. +;; Licensed to the Free Software Foundation. ;; Copyright (C) 2001 Free Software Foundation, Inc. -;; Licensed to the Free Software Foundation. ;; Keywords: mule, multilingual, character set, coding system @@ -1653,18 +1653,18 @@ (defun make-translation-table-from-vector (vec) "Make translation table from decoding vector VEC. -VEC is an array of 256 elements to map unibyte codes to multibyte characters. +VEC is an array of 256 elements to map unibyte codes to multibyte +characters. Elements may be nil for undefined code points. See also the variable `nonascii-translation-table'." (let ((table (make-char-table 'translation-table)) (rev-table (make-char-table 'translation-table)) - (i 0) ch) - (while (< i 256) + (dotimes (i 256) (setq ch (aref vec i)) - (aset table i ch) - (if (>= ch 256) - (aset rev-table ch i)) - (setq i (1+ i))) + (when ch + (aset table i ch) + (if (>= ch 256) + (aset rev-table ch i)))) (set-char-table-extra-slot table 0 rev-table) table))