From 7f8d6d844ba8a442d54d8e6244011fa906e9df5f Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 9 Mar 1998 17:48:14 +0000 Subject: [PATCH] tm 7.56. --- ChangeLog | 67 +++++++++++++++++++++++++ Makefile | 2 +- emu-e19.el | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ emu-mule.el | 84 +++++++++++++++++++------------ emu-nemacs.el | 44 ++++++++++++++--- emu-x20.el | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ emu.el | 18 +++++-- 7 files changed, 471 insertions(+), 42 deletions(-) create mode 100644 emu-e19.el create mode 100644 emu-x20.el diff --git a/ChangeLog b/ChangeLog index c41cbd5..4375033 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,70 @@ +Mon Apr 29 06:30:47 1996 MORIOKA Tomohiko + + * tl: Version 7.22.1 was released. + +Sun Apr 28 16:53:05 1996 MORIOKA Tomohiko + + * emu-x20.el (find-charset-string, find-charset-region): don't + include ascii. + +Sat Apr 27 19:08:03 1996 MORIOKA Tomohiko + + * emu-x20.el (lc-ascii, lc-ltn1, lc-ltn2, lc-ltn3, lc-ltn4, + lc-crl, lc-arb, lc-grk, lc-hbw, lc-ltn5, lc-jp, lc-jp2, lc-kr, + lc-big5-1, lc-big5-2, lc-cn, lc-cns1, lc-cns2, lc-cns3, lc-cns4, + lc-cns5, lc-cns6, lc-cns7): New constant. + +Sat Apr 27 15:43:06 1996 MORIOKA Tomohiko + + * bitmap.el (bitmap-show-xbm): `j' should be defined as local + variable. + + * tl-els: add emu-x20.el. + +Sat Apr 27 15:25:33 1996 MORIOKA Tomohiko + + * emu.el: require emu-x20 if running XEmacs 20 with Mule feature. + +Sat Apr 27 15:24:00 1996 MORIOKA Tomohiko + + * emu-x20.el: New module for XEmacs 20 with Mule. + +Sat Apr 27 13:48:55 1996 MORIOKA Tomohiko + + * emu-e19.el (decode-coding-region): New function. + (encode-coding-region): New function. + (decode-coding-string): New function. + (encode-coding-string): New function. + +Sat Apr 27 13:36:32 1996 MORIOKA Tomohiko + + * emu-nemacs.el (decode-coding-region): New function. + (encode-coding-region): New function. + (decode-coding-string): New function. + (encode-coding-string): New function. + + * emu-nemacs.el: KOBAYASHI Shuhei's address was changed. + +Sat Apr 27 13:27:06 1996 MORIOKA Tomohiko + + * emu-mule.el (decode-coding-region): New function. + (encode-coding-region): New function. + (decode-coding-string): New function. + (encode-coding-string): New function. + + * tl-els: emu-19.el was renamed to `emu-e19.el'. + + * emu-mule.el (fontset-pixel-size): New implementation. + +Sat Apr 27 11:21:45 1996 MORIOKA Tomohiko + + * emu.el, emu-e19.el: emu-orig.el was renamed to `emu-e19.el'. + + * emu-nemacs.el, emu-e19.el: Alias `get-lc' was abolished. + + * emu-mule.el: Function `get-lc' was abolished. + + Fri Apr 26 05:28:30 1996 MORIOKA Tomohiko * tl: Version 7.22 was released. diff --git a/Makefile b/Makefile index ee52cb8..b68a759 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ FILES = tl/README.en tl/Makefile tl/mk-tl tl/tl-els \ tl/*.el tl/*.bdf \ tl/doc/*.texi tl/ChangeLog -TARFILE = tl-7.22.tar +TARFILE = tl-7.22.1.tar elc: diff --git a/emu-e19.el b/emu-e19.el new file mode 100644 index 0000000..c992f6b --- /dev/null +++ b/emu-e19.el @@ -0,0 +1,152 @@ +;;; +;;; emu-e19.el --- Mule 2 emulation module for Emacs 19 and XEmacs 19 +;;; +;;; Copyright (C) 1995 Free Software Foundation, Inc. +;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko +;;; +;;; Author: MORIOKA Tomohiko +;;; Version: +;;; $Id: emu-e19.el,v 7.10 1996/04/27 13:48:55 morioka Exp $ +;;; Keywords: emulation, compatibility, Mule +;;; +;;; This file is part of tl (Tiny Library). +;;; +;;; This program is free software; you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation; either version 2, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with This program. If not, write to the Free Software +;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;;; +;;; Code: + +;;; @ character set +;;; + +(defconst lc-ascii 0) +(defconst lc-ltn1 129) + +(defun char-charset (chr) + "Return the character set of char CHR. +\[emu-e19.el; XEmacs 20 emulating function]" + (if (< chr 128) + lc-ascii + lc-ltn1)) + +(defalias 'char-leading-char 'char-charset) + +(defun find-charset-string (str) + "Return a list of leading-chars in the string. +\[emu-e19.el; Mule emulating function]" + (if (string-match "[\200-\377]" str) + (list lc-ltn1) + )) + +(defun find-charset-region (start end) + "Return a list of leading-chars in the region between START and END. +\[emu-e19.el; Mule emulating function]" + (if (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char start) + (re-search-forward "[\200-\377]" nil t) + )) + (list lc-ltn1) + )) + + +;;; @ coding-system +;;; + +(defconst *internal* nil) +(defconst *ctext* nil) +(defconst *noconv* nil) + +(defun code-convert-string (str ic oc) + "Convert code in STRING from SOURCE code to TARGET code, +On successful converion, returns the result string, +else returns nil. [emu-e19.el; Mule emulating function]" + str) + +(defun decode-coding-string (str coding-system) + "Decode the string STR which is encoded in CODING-SYSTEM. +\[emu-mule.el; XEmacs 20 emulating function]" + str) + +(defun encode-coding-string (str coding-system) + "Encode the string STR which is encoded in CODING-SYSTEM. +\[emu-mule.el; XEmacs 20 emulating function]" + str) + +(defun code-convert-region (beg end ic oc) + "Convert code of the text between BEGIN and END from SOURCE +to TARGET. On successful conversion returns t, +else returns nil. [emu-e19.el; Mule emulating function]" + t) + +(defun decode-coding-region (start end coding-system &optional buffer) + "Decode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-mule.el; XEmacs 20 emulating function]" + t) + +(defun encode-coding-region (start end coding-system &optional buffer) + "Encode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-mule.el; XEmacs 20 emulating function]" + t) + +(defun code-detect-region (beg end) + "Detect coding-system of the text in the region between START and END. +\[emu-e19.el; Mule emulating function]" + ) + +(defun set-file-coding-system (coding-system &optional force) + ) + + +;;; @ character and string +;;; + +(defun char-bytes (chr) 1) +(defun char-width (chr) 1) + +(defalias 'string-width 'length) + +(defun string-to-char-list (str) + (mapcar (function identity) str) + ) + +(defalias 'sref 'aref) + +(defun truncate-string (str width &optional start-column) + "Truncate STR to fit in WIDTH columns. +Optional non-nil arg START-COLUMN specifies the starting column. +\[emu-e19.el; Mule 2.3 emulating function]" + (or start-column + (setq start-column 0)) + (substring str start-column width) + ) + + +;;; @ etc +;;; + +(cond (running-xemacs + (require 'emu-xemacs)) + (running-emacs-19 + (require 'emu-19) + )) + + +;;; @ end +;;; + +(provide 'emu-e19) + +;;; emu-e19.el ends here diff --git a/emu-mule.el b/emu-mule.el index a9be584..c0af990 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -6,7 +6,7 @@ ;;; ;;; Author: MORIOKA Tomohiko ;;; Version: -;;; $Id: emu-mule.el,v 7.3 1996/04/24 13:48:31 morioka Exp $ +;;; $Id: emu-mule.el,v 7.7 1996/04/27 13:27:06 morioka Exp $ ;;; Keywords: emulation, compatibility, Mule ;;; ;;; This file is part of tl (Tiny Library). @@ -27,31 +27,46 @@ ;;; ;;; Code: -(defun some-element (pred seq) - "Return the first element of sequence SEQ -whose return value applied function PRED is not nil. -[emu-mule; tl-list function]" - (let ((i 0)(len (length seq)) element) - (catch 'tag - (while (< i len) - (if (funcall pred (setq element (elt seq i))) - (throw 'tag element) - ) - (setq i (+ i 1)) - )) - )) +;;; @ character set +;;; +(defalias 'char-charset 'char-leading-char) -;;; @ leading-character + +;;; @ coding system ;;; -(defalias 'char-charset 'char-leading-char) +(defun decode-coding-region (start end coding-system &optional buffer) + "Decode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-mule.el; XEmacs 20 emulating function]" + (save-excursion + (if buffer + (set-buffer buffer) + ) + (code-convert start end coding-system *internal*) + )) -(defun get-lc (chr) - "Return leading character of CHAR or LEADING-CHARACTER." - (if (< chr 128) - lc-ascii - chr)) +(defun encode-coding-region (start end coding-system &optional buffer) + "Encode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-mule.el; XEmacs 20 emulating function]" + (save-excursion + (if buffer + (set-buffer buffer) + ) + (code-convert start end *internal* coding-system) + )) + +(defun decode-coding-string (str coding-system) + "Decode the string STR which is encoded in CODING-SYSTEM. +\[emu-mule.el; XEmacs 20 emulating function]" + (code-convert-string str coding-system *internal*) + ) + +(defun encode-coding-string (str coding-system) + "Encode the string STR which is encoded in CODING-SYSTEM. +\[emu-mule.el; XEmacs 20 emulating function]" + (code-convert-string str *internal* coding-system) + ) ;;; @ version specific features @@ -59,16 +74,25 @@ whose return value applied function PRED is not nil. (cond (running-emacs-19 (require 'emu-19) + (defun fontset-pixel-size (fontset) - (elt - (get-font-info - (some-element - (function - (lambda (n) - (not (= n -1)) - )) - (cdr (get-fontset-info fontset)) - )) 5)) + (let* ((fonts (cdr (get-fontset-info fontset))) + (font + (let ((i 0) + (len (length fonts)) + n) + (catch 'tag + (while (< i len) + (setq n (aref fonts i)) + (if (/= n -1) + (throw 'tag n) + ) + (setq i (1+ i)) + )))) + ) + (if font + (aref (get-font-info font) 5) + ))) ) (running-emacs-18 (require 'emu-18) diff --git a/emu-nemacs.el b/emu-nemacs.el index af80db9..a34a110 100644 --- a/emu-nemacs.el +++ b/emu-nemacs.el @@ -5,9 +5,9 @@ ;;; Copyright (C) 1993 .. 1996 MORIOKA Tomohiko ;;; ;;; Author: MORIOKA Tomohiko -;;; modified by KOBAYASHI Shuhei +;;; modified by KOBAYASHI Shuhei ;;; Version: -;;; $Id: emu-nemacs.el,v 7.12 1996/04/24 13:45:09 morioka Exp $ +;;; $Id: emu-nemacs.el,v 7.15 1996/04/27 13:36:32 morioka Exp $ ;;; Keywords: emulation, compatibility, NEmacs, Mule ;;; ;;; This file is part of tl (Tiny Library). @@ -31,7 +31,7 @@ (require 'emu-18) -;;; @ leading-char +;;; @ character set ;;; (defconst lc-ascii 0) @@ -45,10 +45,9 @@ lc-jp)) (defalias 'char-leading-char 'char-charset) -(defalias 'get-lc 'char-charset) -;;; @ coding-system +;;; @ coding system ;;; (defconst *noconv* 0) @@ -66,12 +65,45 @@ else returns nil. [emu-nemacs.el; Mule emulating function]" (convert-string-kanji-code str ic oc) str)) +(defun decode-coding-string (str coding-system) + "Decode the string STR which is encoded in CODING-SYSTEM. +\[emu-nemacs.el; XEmacs 20 emulating function]" + (convert-string-kanji-code str coding-system 3) + ) + +(defun encode-coding-string (str coding-system) + "Encode the string STR which is encoded in CODING-SYSTEM. +\[emu-nemacs.el; XEmacs 20 emulating function]" + (convert-string-kanji-code str 3 coding-system) + ) + (defun code-convert-region (beg end ic oc) "Convert code of the text between BEGIN and END from SOURCE to TARGET. On successful conversion returns t, else returns nil. [emu-nemacs.el; Mule emulating function]" (if (not (eq ic oc)) - (convert-region-kanji-code beg end ic oc))) + (convert-region-kanji-code beg end ic oc) + )) + +(defun decode-coding-region (start end coding-system &optional buffer) + "Decode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-nemacs.el; XEmacs 20 emulating function]" + (save-excursion + (if buffer + (set-buffer buffer) + ) + (convert-region-kanji-code start end coding-system 3) + )) + +(defun encode-coding-region (start end coding-system &optional buffer) + "Encode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-mule.el; XEmacs 20 emulating function]" + (save-excursion + (if buffer + (set-buffer buffer) + ) + (convert-region-kanji-code start end 3 coding-system) + )) (defun code-detect-region (start end) "Detect coding-system of the text in the region between START and END. diff --git a/emu-x20.el b/emu-x20.el new file mode 100644 index 0000000..7623a11 --- /dev/null +++ b/emu-x20.el @@ -0,0 +1,146 @@ +;;; +;;; emu-x20.el --- Mule 2 emulation module for XEmacs 20 with Mule +;;; +;;; Copyright (C) 1995 Free Software Foundation, Inc. +;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko +;;; +;;; Author: MORIOKA Tomohiko +;;; Version: +;;; $Id: emu-x20.el,v 3.1 1996/04/28 16:53:05 morioka Exp $ +;;; Keywords: emulation, compatibility, Mule, XEmacs +;;; +;;; This file is part of tl (Tiny Library). +;;; +;;; This program is free software; you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation; either version 2, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with This program. If not, write to the Free Software +;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;;; +;;; Code: + +;;; @ character set +;;; + +(defalias 'char-leading-char 'char-charset) + +(defun find-charset-string (string) + "Return a list of charsets in the STRING except ascii. +\[emu-x20.el; Mule emulating function]" + (delq 'ascii (charsets-in-string string)) + ) + +(defun find-charset-region (start end) + "Return a list of charsets except ascii +in the region between START and END. +\[emu-x20.el; Mule emulating function]" + (delq 'ascii (charsets-in-region start end)) + ) + +(defconst lc-ascii 'ascii) +(defconst lc-ltn1 'latin-1) +(defconst lc-ltn2 'latin-2) +(defconst lc-ltn3 'latin-3) +(defconst lc-ltn4 'latin-4) +(defconst lc-crl 'cyrillic) +(defconst lc-arb 'arabic) +(defconst lc-grk 'greek) +(defconst lc-hbw 'hebrew) +(defconst lc-ltn5 'latin-5) +(defconst lc-jp 'japanese) +(defconst lc-jp2 'japanese-2) +(defconst lc-kr 'korean) +(defconst lc-big5-1 'chinese-big5-1) +(defconst lc-big5-2 'chinese-big5-2) +(defconst lc-cn 'chinese-gb) +(defconst lc-cns1 'chinese-cns-1) +(defconst lc-cns2 'chinese-cns-2) +(defconst lc-cns3 'chinese-cns-3) +(defconst lc-cns4 'chinese-cns-4) +(defconst lc-cns5 'chinese-cns-5) +(defconst lc-cns6 'chinese-cns-6) +(defconst lc-cns7 'chinese-cns-7) + + +;;; @ coding-system +;;; + +(defconst *noconv* 'noconv) +(defconst *ctext* 'ctext) + +(defvar code-converter-is-broken (string-match "(beta17)" emacs-version)) + +(if code-converter-is-broken +(progn +;;; +(defun decode-coding-region (start end coding-system &optional buffer) + "Decode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-x20.el; XEmacs 20 emulating function]" + (save-excursion + (if buffer + (set-buffer buffer) + ) + (save-restriction + (narrow-to-region start end) + (let ((process-output-coding-system 'noconv) + (process-input-coding-system coding-system)) + (call-process-region start end "cat" t t nil) + )))) + +(defun encode-coding-region (start end coding-system &optional buffer) + "Encode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-x20.el; XEmacs 20 emulating function]" + (save-excursion + (if buffer + (set-buffer buffer) + ) + (save-restriction + (narrow-to-region start end) + (let ((process-output-coding-system coding-system) + (process-input-coding-system 'noconv)) + (call-process-region start end "cat" t t nil) + )))) +;;; +)) + + +;;; @ character and string +;;; + +(defun char-bytes (chr) 1) +(defun char-width (chr) 1) + +(defalias 'string-width 'length) + +(defalias 'sref 'aref) + +(defun truncate-string (str width &optional start-column) + "Truncate STR to fit in WIDTH columns. +Optional non-nil arg START-COLUMN specifies the starting column. +\[emu-x20.el; Mule 2.3 emulating function]" + (or start-column + (setq start-column 0)) + (substring str start-column width) + ) + + +;;; @ etc +;;; + +(require 'emu-xemacs) + + +;;; @ end +;;; + +(provide 'emu-x20) + +;;; emu-x20.el ends here diff --git a/emu.el b/emu.el index 7af8d70..4b59ff3 100644 --- a/emu.el +++ b/emu.el @@ -7,7 +7,7 @@ ;;; Author: MORIOKA Tomohiko ;;; modified by Shuhei KOBAYASHI ;;; Version: -;;; $Id: emu.el,v 7.8 1996/04/24 00:13:31 morioka Exp $ +;;; $Id: emu.el,v 7.10 1996/04/27 15:25:33 morioka Exp $ ;;; Keywords: emulation, compatibility, NEmacs, Mule, XEmacs ;;; ;;; This file is part of tl (Tiny Library). @@ -41,10 +41,18 @@ (or (and running-emacs-19 (>= emacs-minor-version 29)) (>= emacs-major-version 20))) -(cond ((boundp 'MULE) (require 'emu-mule)) - ((boundp 'NEMACS)(require 'emu-nemacs)) - (t (require 'emu-orig)) - ) +(cond ((boundp 'MULE) + (require 'emu-mule) + ) + ((and running-xemacs-20 (featurep 'mule)) + (require 'emu-x20) + ) + ((boundp 'NEMACS) + (require 'emu-nemacs) + ) + (t + (require 'emu-e19) + )) ;;; @ Emacs 19.29 emulation -- 1.7.10.4