From: Dave Love Date: Wed, 12 Dec 2001 19:55:31 +0000 (+0000) Subject: (make-translation-table-from-vector): X-Git-Tag: ttn-vms-21-2-B4~17766 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9e3b6057bada7341904ec3c6f614e41e773321fa;p=emacs.git (make-translation-table-from-vector): Allow null elements in VEC. --- diff --git a/lisp/international/mule.el b/lisp/international/mule.el index a39e2145d82..f8468f999c8 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1,8 +1,8 @@ ;;; mule.el --- basic commands for mulitilingual environment ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. -;; Copyright (C) 2001 Free Software Foundation, Inc. ;; Licensed to the Free Software Foundation. +;; Copyright (C) 2001 Free Software Foundation, Inc. ;; Keywords: mule, multilingual, character set, coding system @@ -1653,18 +1653,18 @@ character, say TO-ALT, FROM is also translated to TO-ALT." (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))