diff options
| author | Dave Love | 2001-12-12 19:55:31 +0000 |
|---|---|---|
| committer | Dave Love | 2001-12-12 19:55:31 +0000 |
| commit | 9e3b6057bada7341904ec3c6f614e41e773321fa (patch) | |
| tree | 92419b1c085df6905306e89fc7973f7387d4f37f | |
| parent | e4364402e1fbc39a64af82d2459f9f4240542b6d (diff) | |
| download | emacs-9e3b6057bada7341904ec3c6f614e41e773321fa.tar.gz emacs-9e3b6057bada7341904ec3c6f614e41e773321fa.zip | |
(make-translation-table-from-vector):
Allow null elements in VEC.
| -rw-r--r-- | lisp/international/mule.el | 16 |
1 files changed, 8 insertions, 8 deletions
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 @@ | |||
| 1 | ;;; mule.el --- basic commands for mulitilingual environment | 1 | ;;; mule.el --- basic commands for mulitilingual environment |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | 3 | ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
| 4 | ;; Copyright (C) 2001 Free Software Foundation, Inc. | ||
| 5 | ;; Licensed to the Free Software Foundation. | 4 | ;; Licensed to the Free Software Foundation. |
| 5 | ;; Copyright (C) 2001 Free Software Foundation, Inc. | ||
| 6 | 6 | ||
| 7 | ;; Keywords: mule, multilingual, character set, coding system | 7 | ;; Keywords: mule, multilingual, character set, coding system |
| 8 | 8 | ||
| @@ -1653,18 +1653,18 @@ character, say TO-ALT, FROM is also translated to TO-ALT." | |||
| 1653 | 1653 | ||
| 1654 | (defun make-translation-table-from-vector (vec) | 1654 | (defun make-translation-table-from-vector (vec) |
| 1655 | "Make translation table from decoding vector VEC. | 1655 | "Make translation table from decoding vector VEC. |
| 1656 | VEC is an array of 256 elements to map unibyte codes to multibyte characters. | 1656 | VEC is an array of 256 elements to map unibyte codes to multibyte |
| 1657 | characters. Elements may be nil for undefined code points. | ||
| 1657 | See also the variable `nonascii-translation-table'." | 1658 | See also the variable `nonascii-translation-table'." |
| 1658 | (let ((table (make-char-table 'translation-table)) | 1659 | (let ((table (make-char-table 'translation-table)) |
| 1659 | (rev-table (make-char-table 'translation-table)) | 1660 | (rev-table (make-char-table 'translation-table)) |
| 1660 | (i 0) | ||
| 1661 | ch) | 1661 | ch) |
| 1662 | (while (< i 256) | 1662 | (dotimes (i 256) |
| 1663 | (setq ch (aref vec i)) | 1663 | (setq ch (aref vec i)) |
| 1664 | (aset table i ch) | 1664 | (when ch |
| 1665 | (if (>= ch 256) | 1665 | (aset table i ch) |
| 1666 | (aset rev-table ch i)) | 1666 | (if (>= ch 256) |
| 1667 | (setq i (1+ i))) | 1667 | (aset rev-table ch i)))) |
| 1668 | (set-char-table-extra-slot table 0 rev-table) | 1668 | (set-char-table-extra-slot table 0 rev-table) |
| 1669 | table)) | 1669 | table)) |
| 1670 | 1670 | ||