+Mon May 27 14:04:12 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tl: Version 7.27.1 was released.
+
+ * emu-mule.el (charset-*): New constants.
+
+ * emu-x20.el (charset-*): New constants.
+ (charset-description): New alias.
+
+ * emu-e19.el (char-charset):
+ Use constant `charset-ascii' and `charset-latin-1'.
+
+Mon May 27 12:17:42 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-nemacs.el (char-charset): Use constant `charset-ascii' and
+ `charset-jisx0208'.
+
+ * emu-nemacs.el (charset-ascii): New constant.
+ (charset-jisx0208): New constant.
+
+Mon May 27 12:06:05 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-mule.el (charset-description): New alias.
+ (charset-registry): New alias.
+ (charset-columns): New alias.
+ (charset-direction): New alias.
+
+Mon May 27 11:28:24 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-mule.el (string-columns): New alias.
+
+ * emu-nemacs.el, emu-e19.el, emu-x20.el (string-columns): New
+ alias; You should use it instead of `string-width'.
+
+Mon May 27 10:07:19 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-nemacs.el (truncate-string): Use function `char-columns'
+ instead of `char-width'.
+
+Mon May 27 10:01:14 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-mule.el (char-columns): New alias.
+
+ * emu-nemacs.el, emu-e19.el, emu-x20.el (char-columns): New
+ function; You should use it instead of `char-width'.
+
+Sat May 25 20:23:36 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-xemacs.el (invisible-p): New function.
+ (next-visible-point): New function.
+
+Sat May 25 20:21:22 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-19.el (invisible-p): New function.
+ (next-visible-point): New function.
+
+Sat May 25 20:14:52 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-18.el (invisible-p): New function.
+ (next-visible-point): New function.
+
+Sat May 25 19:51:23 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-18.el (invisible-region): New function.
+ (visible-region): New function.
+
+Sat May 25 19:28:13 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-xemacs.el (invisible-region): New function.
+ (visible-region): New function.
+
+Sat May 25 19:22:50 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu-19.el (invisible-region): New function.
+ (visible-region): New function.
+
+\f
Thu May 23 01:31:02 1996 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* tl: Version 7.27 was released.
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: emu-18.el,v 7.15 1996/05/09 15:09:00 morioka Exp $
+;;; $Id: emu-18.el,v 7.18 1996/05/26 02:05:52 morioka Exp $
;;; Keywords: emulation, compatibility
;;;
;;; This file is part of tl (Tiny Library).
(defun tl:overlay-buffer (overlay))
+;;; @@ visible/invisible
+;;;
+
+(defun invisible-region (start end)
+ (let ((buffer-read-only nil) ;Okay even if write protected.
+ (modp (buffer-modified-p)))
+ (if (save-excursion
+ (goto-char (1- end))
+ (eq (following-char) ?\n)
+ )
+ (setq end (1- end))
+ )
+ (unwind-protect
+ (subst-char-in-region start end ?\n ?\^M t)
+ (set-buffer-modified-p modp)
+ )))
+
+(defun visible-region (start end)
+ (let ((buffer-read-only nil) ;Okay even if write protected.
+ (modp (buffer-modified-p)))
+ (unwind-protect
+ (subst-char-in-region start end ?\^M ?\n t)
+ (set-buffer-modified-p modp)
+ )))
+
+(defun invisible-p (pos)
+ (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\^M)
+ ))
+
+(defun next-visible-point (pos)
+ (save-excursion
+ (goto-char pos)
+ (end-of-line)
+ (if (eq (following-char) ?\n)
+ (forward-char)
+ )
+ (point)
+ ))
+
+
;;; @ mouse
;;;
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: emu-19.el,v 7.4 1996/05/14 16:22:38 morioka Exp $
+;;; $Id: emu-19.el,v 7.7 1996/05/26 01:48:47 morioka Exp $
;;; Keywords: emulation, compatibility
;;;
;;; This file is part of tl (Tiny Library).
(defalias 'tl:overlay-buffer 'overlay-buffer)
+;;; @@ visible/invisible
+;;;
+
+(defun invisible-region (start end)
+ (if (save-excursion
+ (goto-char (1- end))
+ (eq (following-char) ?\n)
+ )
+ (setq end (1- end))
+ )
+ (put-text-property start end 'invisible t)
+ )
+
+(defun visible-region (start end)
+ (put-text-property start end 'invisible nil)
+ )
+
+(defun invisible-p (pos)
+ (get-text-property pos 'invisible)
+ )
+
+(defun next-visible-point (pos)
+ (save-excursion
+ (goto-char (next-single-property-change pos 'invisible))
+ (if (eq (following-char) ?\n)
+ (forward-char)
+ )
+ (point)
+ ))
+
+
;;; @ mouse
;;;
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: emu-e19.el,v 7.14 1996/05/15 14:00:04 morioka Exp $
+;;; $Id: emu-e19.el,v 7.18 1996/05/27 12:25:34 morioka Exp $
;;; Keywords: emulation, compatibility, Mule, Latin-1
;;;
;;; This file is part of tl (Tiny Library).
;;; @ 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)
+(defconst charset-ascii 0 "Character set of ASCII")
+(defconst charset-latin-1 129 "Character set of ISO-8859-1")
-(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)
- ))
+;;; @@ for Mule emulation
+;;;
-(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)
- ))
+(defconst lc-ascii 0)
+(defconst lc-ltn1 129)
;;; @ coding-system
)
-;;; @ character and string
+;;; @ character
;;;
(defun char-bytes (chr) 1)
-(defun char-width (chr) 1)
-(defalias 'string-width 'length)
+(defun char-columns (character)
+ "Return number of columns a CHARACTER occupies when displayed.
+\[emu-nemacs.el]"
+ 1)
+
+(defun char-charset (chr)
+ "Return the character set of char CHR.
+\[emu-e19.el; XEmacs 20 emulating function]"
+ (if (< chr 128)
+ charset-ascii
+ charset-latin-1))
+
+(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)
+ ))
+
+;;; @@ for Mule emulation
+;;;
+
+(defalias 'char-width 'char-columns)
+
+(defalias 'char-leading-char 'char-charset)
+
+
+;;; @ string
+;;;
+
+(defalias 'string-columns 'length)
(defun string-to-char-list (str)
(mapcar (function identity) str)
(substring str start-column width)
)
+;;; @@ for Mule emulation
+;;;
+
+(defalias 'string-width 'length)
+
;;; @ end
;;;
;;; emu-mule.el --- Mule 2.* emulation module for Mule
;;;
;;; Copyright (C) 1995 Free Software Foundation, Inc.
-;;; Copyright (C) 1994,1995 MORIOKA Tomohiko
+;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: emu-mule.el,v 7.13 1996/05/14 16:28:33 morioka Exp $
+;;; $Id: emu-mule.el,v 7.21 1996/05/27 14:08:00 morioka Exp $
;;; Keywords: emulation, compatibility, Mule
;;;
;;; This file is part of tl (Tiny Library).
;;; @ character set
;;;
-(defalias 'char-charset 'char-leading-char)
+;; 94 character set
+(defconst charset-ascii lc-ascii "ASCII")
+(defconst charset-jisx0201-kana lc-kana "JIS X0201 Katakana")
+(defconst charset-jisx0201-latin lc-roman "JIS X0201 Latin")
+
+;; 96 character set
+(defconst charset-latin-1 lc-ltn1 "ISO-8859-1 (Latin-1)")
+(defconst charset-latin-2 lc-ltn2 "ISO-8859-2 (Latin-2)")
+(defconst charset-latin-3 lc-ltn3 "ISO-8859-3 (Latin-3)")
+(defconst charset-latin-4 lc-ltn4 "ISO-8859-4 (Latin-4)")
+(defconst charset-cyrillic lc-crl "ISO-8859-5 (Cyrillic)")
+(defconst charset-arabic lc-arb "ISO-8859-6 (Arabic)")
+(defconst charset-greek lc-grk "ISO-8859-7 (Greek)")
+(defconst charset-hebrew lc-hbw "ISO-8859-8 (Hebrew)")
+(defconst charset-latin-5 lc-ltn5 "ISO-8859-9 (Latin-5)")
+
+;; 94x94 character set
+(defconst charset-jisx0208-1978 lc-jpold "JIS X0208-1978")
+(defconst charset-gb2312 lc-cn "GB 2312-1980")
+(defconst charset-jisx0208 lc-jp "JIS X0208-1983")
+(defconst charset-ksc5601 lc-kr "KS C5601-1987")
+(defconst charset-jisx0212 lc-jp2 "JIS X0212-1990")
+(defconst charset-cns11643-1 lc-cns1 "CNS 11643-1986 plane 1")
+(defconst charset-cns11643-2 lc-cns2 "CNS 11643-1986 plane 2")
+(defconst charset-cns11643-3 lc-cns3 "CNS 11643-1986 plane 3")
+(defconst charset-cns11643-4 lc-cns4 "CNS 11643-1986 plane 4")
+(defconst charset-cns11643-5 lc-cns5 "CNS 11643-1986 plane 5")
+(defconst charset-cns11643-6 lc-cns6 "CNS 11643-1986 plane 6")
+(defconst charset-cns11643-7 lc-cns7 "CNS 11643-1986 plane 7")
+
+;; Big 5
+(defconst charset-big5-1 lc-big5-1 "Big5 Level 1")
+(defconst charset-big5-2 lc-big5-2 "Big5 Level 2")
+
+(defalias 'charset-description 'char-description)
+(defalias 'charset-registry 'char-registry)
+(defalias 'charset-columns 'char-width)
+(defalias 'charset-direction 'char-direction)
;;; @ coding system
)
-;;; @ character and string
+;;; @ character
+;;;
+
+(defalias 'char-charset 'char-leading-char)
+
+(defalias 'char-columns 'char-width)
+
+
+;;; @ string
;;;
+(defalias 'string-columns 'string-width)
+
(defalias 'string-to-int-list 'string-to-char-list)
(or (fboundp 'truncate-string)
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; modified by KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>
;;; Version:
-;;; $Id: emu-nemacs.el,v 7.19 1996/05/09 15:06:53 morioka Exp $
+;;; $Id: emu-nemacs.el,v 7.27 1996/05/27 12:27:59 morioka Exp $
;;; Keywords: emulation, compatibility, NEmacs, Mule
;;;
;;; This file is part of tl (Tiny Library).
;;; @ character set
;;;
-(defconst lc-ascii 0)
-(defconst lc-jp 146)
+(defconst charset-ascii 0 "Character set of ASCII")
+(defconst charset-jisx0208 146 "Character set of JIS X0208-1983")
-(defun char-charset (chr)
- "Return the character set of char CHR.
-\[emu-nemacs.el; XEmacs 20 emulating function]"
- (if (< chr 128)
- lc-ascii
- lc-jp))
+;;; @@ for Mule emulation
+;;;
-(defalias 'char-leading-char 'char-charset)
+(defconst lc-ascii 0)
+(defconst lc-jp 146)
;;; @ coding system
)
-;;; @ character and string
+;;; @ character
;;;
+(defun char-charset (chr)
+ "Return the character set of char CHR.
+\[emu-nemacs.el; XEmacs 20 emulating function]"
+ (if (< chr 128)
+ charset-ascii
+ charset-jisx0208))
+
(defun char-bytes (chr)
"Return number of bytes CHAR will occupy in a buffer.
\[emu-nemacs.el; Mule emulating function]"
(if (< chr 128) 1 2))
-(defun char-width (chr)
- "Return number of columns CHAR will occupy when displayed.
-\[emu-nemacs.el; Mule emulating function]"
- (if (< chr 128) 1 2))
+(defun char-columns (character)
+ "Return number of columns a CHARACTER occupies when displayed.
+\[emu-nemacs.el]"
+ (if (< character 128)
+ 1
+ 2))
-(defun string-width (str)
- "Return number of columns STRING will occupy.
-\[emu-nemacs.el; Mule emulating function]"
- (length str))
+;;; @@ for Mule emulation
+;;;
+
+(defalias 'char-leading-char 'char-charset)
+
+(defalias 'char-width 'char-columns)
+
+
+;;; @ string
+;;;
+
+(defalias 'string-columns 'length)
(defun sref (str idx)
"Return the character in STR at index IDX.
""
(while (< column start-column)
(setq ch (aref str from)
- column (+ column (char-width ch))
+ column (+ column (char-columns ch))
from (+ from (char-bytes ch))))
(if (< width max-width)
(progn
(setq to from)
(while (<= column width)
(setq ch (aref str to)
- column (+ column (char-width ch))
+ column (+ column (char-columns ch))
to-prev to
to (+ to (char-bytes ch))))
(setq to to-prev)))
(substring str from to))))
+;;; @@ for Mule emulation
+;;;
+
+(defalias 'string-width 'length)
+
;;; @ text property emulation
;;;
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: emu-x20.el,v 7.4 1996/05/20 15:52:28 morioka Exp $
+;;; $Id: emu-x20.el,v 7.11 1996/05/27 14:09:18 morioka Exp $
;;; Keywords: emulation, compatibility, Mule, XEmacs
;;;
;;; This file is part of tl (Tiny Library).
;;; @ 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))
- )
+(mapcar (lambda (charset)
+ (set
+ (cond ((eq charset 'japanese-kana) 'charset-jisx0201-kana)
+ ((eq charset 'japanese-roman) 'charset-jisx0201-latin)
+ ((eq charset 'japanese-old) 'charset-jisx0208-1978)
+ ((eq charset 'chinese-gb) 'charset-gb2312)
+ ((eq charset 'japanese) 'charset-jisx0208)
+ ((eq charset 'koran) 'charset-ksc5601)
+ ((eq charset 'japanese-2) 'charset-jisx0212)
+ ((eq charset 'chinese-cns-1) 'charset-cns11643-1)
+ ((eq charset 'chinese-cns-2) 'charset-cns11643-2)
+ ((eq charset 'chinese-cns-3) 'charset-cns11643-3)
+ ((eq charset 'chinese-cns-4) 'charset-cns11643-4)
+ ((eq charset 'chinese-cns-5) 'charset-cns11643-5)
+ ((eq charset 'chinese-cns-6) 'charset-cns11643-6)
+ ((eq charset 'chinese-cns-7) 'charset-cns11643-7)
+ ((eq charset 'chinese-big5-1) 'charset-big5-1)
+ ((eq charset 'chinese-big5-2) 'charset-big5-2)
+ (t (intern (concat "charset-" (symbol-name charset))))
+ )
+ charset)
+ )
+ (charset-list)
+ )
+
+(defalias 'charset-description 'charset-doc-string)
+
+;;; @@ for Mule emulation
+;;;
(defconst lc-ascii 'ascii)
(defconst lc-ltn1 'latin-1)
(defalias 'character-decode-region 'decode-coding-region)
-;;; @ character and string
+;;; @ character
;;;
(defun char-bytes (chr) 1)
-(defun char-width (chr) 1)
-(defalias 'string-width 'length)
+(defun char-columns (character)
+ "Return number of columns a CHARACTER occupies when displayed.
+\[emu-x20.el]"
+ (charset-columns (char-charset character))
+ )
+
+;;; @@ Mule emulating aliases
+;;;
+;;; You should not use them.
+
+(defalias 'char-width 'char-columns)
+
+(defalias 'char-leading-char 'char-charset)
+
+
+;;; @ string
+;;;
+
+(defun string-columns (string)
+ "Return number of columns STRING occupies when displayed.
+\[emu-x20.el]"
+ (let ((col 0)
+ (len (length string))
+ (i 0))
+ (while (< i len)
+ (setq col (+ col (char-columns (aref string i))))
+ (setq i (1+ i))
+ )
+ col))
+
+(defalias 'string-width 'string-column)
(defun string-to-int-list (str)
(mapcar #'char-int str)
(substring str start-column width)
)
+(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))
+ )
+
;;; @ end
;;;
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: emu-xemacs.el,v 7.5 1996/05/15 14:05:34 morioka Exp $
+;;; $Id: emu-xemacs.el,v 7.8 1996/05/26 02:13:21 morioka Exp $
;;; Keywords: emulation, compatibility, XEmacs
;;;
;;; This file is part of tl (Tiny Library).
)
+;;; @@ visible/invisible
+;;;
+
+(defun invisible-region (start end)
+ (if (save-excursion
+ (goto-char start)
+ (eq (following-char) ?\n)
+ )
+ (setq start (1+ start))
+ )
+ (put-text-property start end 'invisible t)
+ )
+
+(defun visible-region (start end)
+ (put-text-property start end 'invisible nil)
+ )
+
+(defun invisible-p (pos)
+ (if (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\n)
+ )
+ (setq pos (1+ pos))
+ )
+ (get-text-property pos 'invisible)
+ )
+
+(defun next-visible-point (pos)
+ (save-excursion
+ (if (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\n)
+ )
+ (setq pos (1+ pos))
+ )
+ (next-single-property-change pos 'invisible)
+ ))
+
+
;;; @ mouse
;;;