;;; utf-8.el --- UTF-8 decoding/encoding support -*- coding: iso-2022-7bit -*-
-;; Copyright (C) 2001, 2004 Electrotechnical Laboratory, JAPAN.
-;; Licensed to the Free Software Foundation.
-;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; National Institute of Advanced Industrial Science and Technology (AIST)
+;; Registration Number H14PRO021
;; Author: TAKAHASHI Naoto <ntakahas@m17n.org>
;; Maintainer: FSF
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; Here we bind coding-system-for-read to nil so that coding tags
;; in the files are respected even if the files are not yet
;; byte-compiled
- (let ((coding-system-for-read nil))
+ (let ((coding-system-for-read nil)
+ ;; We must avoid clobbering this variable, in case the load
+ ;; files below use different coding systems.
+ (last-coding-system-used last-coding-system-used))
(cond ((string= "Korean" current-language-environment)
(load "subst-jis")
(load "subst-big5")
'help-echo 'utf-8-help-echo)
(if (= l 2)
(put-text-property (point) (min (point-max) (+ l (point)))
- 'display (format "\\%03o" ch))
+ 'display (propertize (format "\\%03o" ch)
+ 'face 'escape-glyph))
(compose-region (point) (+ l (point)) ?\e$,3u=\e(B))
(forward-char l))
(forward-char 1))))
(set-buffer-multibyte nil)))
(when (and utf-8-compose-scripts (> length 1))
- ;; These currently have definitions which cover the relevant
- ;; unicodes. We could avoid loading thai-util &c by checking
- ;; whether the region contains any characters with the appropriate
- ;; categories. There aren't yet Unicode-based rules for Tibetan.
- (diacritic-compose-region (point-max) (point-min))
- (thai-compose-region (point-max) (point-min))
- (lao-compose-region (point-max) (point-min))
- (devanagari-compose-region (point-max) (point-min))
- (malayalam-compose-region (point-max) (point-min))
- (tamil-compose-region (point-max) (point-min)))
+ ;; This let-binding avoids recursive auto-loading. And, we
+ ;; anyway don't have to run the following code while
+ ;; auto-loading.
+ (let ((utf-8-compose-scripts nil))
+ ;; These currently have definitions which cover the relevant
+ ;; unicodes. We could avoid loading thai-util &c by checking
+ ;; whether the region contains any characters with the appropriate
+ ;; categories. There aren't yet Unicode-based rules for Tibetan.
+ (diacritic-compose-region (point-max) (point-min))
+ (thai-compose-region (point-max) (point-min))
+ (lao-compose-region (point-max) (point-min))
+ (devanagari-compose-region (point-max) (point-min))
+ (malayalam-compose-region (point-max) (point-min))
+ (tamil-compose-region (point-max) (point-min))))
(- (point-max) (point-min)))))
(defun utf-8-pre-write-conversion (beg end)
This is used as a post-read-conversion of utf-8 coding system."
(if (and utf-translate-cjk-mode
(not utf-translate-cjk-lang-env)
- (save-excursion
- (goto-char beg)
- (re-search-forward "\\cc\\|\\cj\\|\\ch" end t)))
+ (if (stringp beg)
+ (string-match "\\cc\\|\\cj\\|\\ch" beg)
+ (save-excursion
+ (goto-char beg)
+ (re-search-forward "\\cc\\|\\cj\\|\\ch" end t))))
(utf-translate-cjk-load-tables))
nil)