From c3f93042152b3562bc42cba0d3a11ca368a0290a Mon Sep 17 00:00:00 2001 From: morioka Date: Tue, 10 Mar 1998 05:21:40 +0000 Subject: [PATCH] tm 7.89. --- ChangeLog | 42 ++++++++++++++++++++++++++++++++++++++ emu-e19.el | 4 ++++ emu-e20.el | 56 +++++++++++++++++++++++++++++++++------------------ emu-mule.el | 3 +++ emu-nemacs.el | 4 ++++ emu-x20.el | 7 +++++-- 6 files changed, 94 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index a838261..3700a94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,45 @@ +Tue Oct 1 15:03:36 1996 MORIOKA Tomohiko + + * tl: Version 7.61.9 was released. + + * bitmap.el: modified for mule-19.33-gamma. + +Tue Oct 1 13:28:03 1996 MORIOKA Tomohiko + + * emu-e19.el, emu-nemacs.el, emu-mule.el + (find-non-ascii-charset-string): New alias. + (find-non-ascii-charset-region): New alias. + +Tue Oct 1 13:22:13 1996 MORIOKA Tomohiko + + * emu-x20.el (find-charset-string): Changed to alias for + `charsets-in-string'. + + (find-charset-region): Changed to alias for `charsets-in-region'. + + (find-non-ascii-charset-string): New function. + + (find-non-ascii-charset-region): New function. + +Tue Oct 1 13:18:34 1996 MORIOKA Tomohiko + + * emu-e20.el (fontset-height): New function. + + (find-non-ascii-charset-string): New function; renamed from + `find-charset-string'. + + (find-non-ascii-charset-region): New function; renamed from + `find-charset-region'. + + (detect-mime-charset-region): Use function `find-charset-string' + instead of `find-charset-in-string'. + +Wed Sep 25 12:07:40 1996 MORIOKA Tomohiko + + * emu-e20.el (truncate-string): check `to' is smaller than length + of string. + + Tue Sep 24 22:02:05 1996 MORIOKA Tomohiko * tl: Version 7.61.8 was released. diff --git a/emu-e19.el b/emu-e19.el index 8b15261..24fe3ed 100644 --- a/emu-e19.el +++ b/emu-e19.el @@ -71,6 +71,8 @@ (list lc-ltn1) )) +(defalias 'find-non-ascii-charset-string 'find-charset-string) + (defun find-charset-region (start end) "Return a list of charsets in the region between START and END. \[emu-e19.el; Mule emulating function]" @@ -83,6 +85,8 @@ (list lc-ltn1) )) +(defalias 'find-non-ascii-charset-region 'find-charset-region) + ;;; @@ for old MULE emulation ;;; diff --git a/emu-e20.el b/emu-e20.el index 1f39ff4..257cefa 100644 --- a/emu-e20.el +++ b/emu-e20.el @@ -1,10 +1,10 @@ -;;; emu-e20.el --- emu API implementation for mule merged EMACS +;;; emu-e20.el --- emu API implementation for mule merged Emacs ;; Copyright (C) 1996 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko ;; Version: $Id$ -;; Keywords: emulation, compatibility, MULE +;; Keywords: emulation, compatibility, Mule ;; This file is part of tl (Tiny Library). @@ -30,23 +30,38 @@ (require 'emu-19) +(defun fontset-height (fontset) + (let* ((info (fontset-info fontset)) + (height (aref info 1)) + ) + (if (> height 0) + height + (let ((str + (car (aref (aref info 2) 0)) + )) + (if (string-match "--\\([0-9]+\\)-\\*-\\*-\\*-\\*-\\*-ISO8859-1" str) + (string-to-number + (substring str (match-beginning 1)(match-end 1)) + ) + 0))))) + ;;; @ character set ;;; (defalias 'charset-columns 'charset-width) -(defun find-charset-string (string) +(defun find-non-ascii-charset-string (string) "Return a list of charsets in the STRING except ascii. -\[emu-e20.el; MULE emulating function]" - (delq charset-ascii (find-charset-in-string string)) +\[emu-e20.el; Mule emulating function]" + (delq charset-ascii (find-charset-string string)) ) -(defun find-charset-region (start end) +(defun find-non-ascii-charset-region (start end) "Return a list of charsets except ascii in the region between START and END. -\[emu-e20.el; MULE emulating function]" - (delq charset-ascii (find-charset-in-string (buffer-substring start end))) +\[emu-e20.el; Mule emulating function]" + (delq charset-ascii (find-charset-string (buffer-substring start end))) ) @@ -57,7 +72,7 @@ in the region between START and END. (defmacro as-binary-process (&rest body) `(let (selective-display ; Disable ^M to nl translation. - ;; for mule merged EMACS + ;; for mule merged Emacs (default-process-coding-system 'no-conversion) ) ,@ body)) @@ -155,7 +170,7 @@ in the region between START and END. (defun detect-mime-charset-region (start end) "Return MIME charset for region between START and END. [emu-e20.el]" (charsets-to-mime-charset - (find-charset-in-string (buffer-substring start end)) + (find-charset-string (buffer-substring start end)) )) (defun encode-mime-charset-region (start end charset) @@ -205,7 +220,7 @@ in the region between START and END. "Return string of category mnemonics for CHAR in TABLE. CHAR can be any multilingual character TABLE defaults to the current buffer's category table. -\[emu-e20.el; MULE emulating function]" +\[emu-e20.el; Mule emulating function]" (category-set-mnemonics (char-category-set character)) ) @@ -219,7 +234,7 @@ TABLE defaults to the current buffer's category table. (defun string-to-char-list (string) "Return a list of which elements are characters in the STRING. -\[emu-e20.el; MULE 2.3 emulating function]" +\[emu-e20.el; Mule 2.3 emulating function]" (let* ((len (length string)) (i 0) l chr) @@ -234,14 +249,14 @@ TABLE defaults to the current buffer's category table. (defalias 'string-to-int-list 'string-to-char-list) (or (fboundp 'truncate-string) -(defun truncate-string (str width &optional start-column) - "Truncate STR to fit in WIDTH columns. +(defun truncate-string (string width &optional start-column) + "Truncate STRING to fit in WIDTH columns. Optional non-nil arg START-COLUMN specifies the starting column. \[emu-e20.el; MULE 2.3 emulating function]" (or start-column (setq start-column 0)) - (let ((max-width (string-width str)) - (len (length str)) + (let ((max-width (string-width string)) + (len (length string)) (from 0) (column 0) to-prev to ch b) @@ -250,7 +265,7 @@ Optional non-nil arg START-COLUMN specifies the starting column. (if (>= start-column width) "" (while (< column start-column) - (setq ch (aref str from) + (setq ch (aref string from) column (+ column (char-width ch)) from (if (= (setq b (charset-bytes ch)) 0) (1+ from) @@ -260,8 +275,9 @@ Optional non-nil arg START-COLUMN specifies the starting column. (if (< width max-width) (progn (setq to from) - (while (<= column width) - (setq ch (aref str to) + (while (and (<= column width) + (< to len)) + (setq ch (aref string to) column (+ column (char-width ch)) to-prev to to (if (= (setq b (charset-bytes ch)) 0) @@ -270,7 +286,7 @@ Optional non-nil arg START-COLUMN specifies the starting column. )) ) (setq to to-prev))) - (substring str from to)))) + (substring string from to)))) ;;; ) diff --git a/emu-mule.el b/emu-mule.el index 2d5deb4..ccc956d 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -58,6 +58,9 @@ ;;; @ character set ;;; +(defalias 'find-non-ascii-charset-string 'find-charset-string) +(defalias 'find-non-ascii-charset-region 'find-charset-region) + (defalias 'charset-bytes 'char-bytes) (defalias 'charset-description 'char-description) (defalias 'charset-registry 'char-registry) diff --git a/emu-nemacs.el b/emu-nemacs.el index e6417e5..c42eb57 100644 --- a/emu-nemacs.el +++ b/emu-nemacs.el @@ -66,6 +66,8 @@ (list lc-jp) )) +(defalias 'find-non-ascii-charset-string 'find-charset-string) + (defun find-charset-region (start end) "Return a list of charsets in the region between START and END. \[emu-nemacs.el; Mule emulating function]" @@ -78,6 +80,8 @@ (list lc-jp) )) +(defalias 'find-non-ascii-charset-region 'find-charset-region) + (defun check-ASCII-string (str) (let ((i 0) len) diff --git a/emu-x20.el b/emu-x20.el index 4279ea4..22840cf 100644 --- a/emu-x20.el +++ b/emu-x20.el @@ -41,13 +41,16 @@ (defalias 'charset-description 'charset-doc-string) -(defun find-charset-string (string) +(defalias 'find-charset-string 'charsets-in-string) +(defalias 'find-charset-region 'charsets-in-region) + +(defun find-non-ascii-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) +(defun find-non-ascii-charset-region (start end) "Return a list of charsets except ascii in the region between START and END. \[emu-x20.el; Mule emulating function]"