From: morioka Date: Thu, 9 Apr 1998 15:45:18 +0000 (+0000) Subject: Sync up with APEL 8.0-pre. X-Git-Tag: apel-unify-8_2~6 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7faa9c0a5f7ad36dc379d4f4832493936b0bd0cb;p=elisp%2Fapel.git Sync up with APEL 8.0-pre. --- diff --git a/ChangeLog b/ChangeLog index d479213..bd54ab4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,41 @@ -1998-04-09 MORIOKA Tomohiko +1998-04-09 MORIOKA Tomohiko + + * emu-e19.el, emu-e20.el: Use 'make-obsolete for 'string-columns. + + * emu-e19.el, emu-nemacs.el, emu-x20.el: Abolish obsolete alias + `char-leading-char'. + +1998-04-09 MORIOKA Tomohiko + + * emu-e20.el, emu-mule.el, emu-nemacs.el, emu-e19.el: Abolish + obsolete alias `char-columns'. + + * emu-e19.el: Abolish constant `charset-ascii' and + `charset-iso8859-1'. + (charset-description): New implementation. + (charset-registry): New implementation. + (charset-width): Renamed from `charset-columns'; new + implementation. + (find-charset-string): New implementation. + (find-charset-region): New implementation. + (charsets-mime-charset-alist): New initial value. + (detect-mime-charset-region): New implementation. + (char-charset): New implementation. + + * emu-nemacs.el: Rename `charset-columns' -> `charset-width'. + + * emu-nemacs.el: Abolish constant `charset-ascii' and + `charset-jisx0208'. + Abolish constant `lc-ascii' and `lc-jp'. + (charset-description): New implementation. + (charset-registry): New implementation. + (charset-columns): New implementation. + (find-charset-string): New implementation. + (find-charset-region): New implementation. + (charsets-mime-charset-alist): New initial value. + (char-charset): New implementation. + +1998-04-09 MORIOKA Tomohiko * emu-e20.el, emu-x20.el, emu-e19.el, emu-mule.el, emu-nemacs.el (char-next-index): New macro. diff --git a/Makefile b/Makefile index beb8bd9..52c1d47 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Makefile for APEL. # -VERSION = 7.5 +VERSION = 8.0 TAR = tar RM = /bin/rm -f diff --git a/emu-e19.el b/emu-e19.el index f4f22ab..ce75ddf 100644 --- a/emu-e19.el +++ b/emu-e19.el @@ -37,37 +37,35 @@ ;;; @ character set ;;; -(defconst charset-ascii 0 "Character set of ASCII") -(defconst charset-latin-iso8859-1 129 "Character set of ISO-8859-1") +(put 'ascii 'charset-description "Character set of ASCII") +(put 'ascii 'charset-registry "ASCII") + +(put 'latin-iso8859-1 'charset-description "Character set of ISO-8859-1") +(put 'latin-iso8859-1 'charset-registry "ISO8859-1") (defun charset-description (charset) - "Return description of CHARSET. [emu-e19.el]" - (if (< charset 128) - (documentation-property 'charset-ascii 'variable-documentation) - (documentation-property 'charset-latin-iso8859-1 'variable-documentation) - )) + "Return description of CHARSET." + (get charset 'charset-description) + ) (defun charset-registry (charset) - "Return registry name of CHARSET. [emu-e19.el]" - (if (< charset 128) - "ASCII" - "ISO8859-1")) - -(defun charset-columns (charset) - "Return number of columns a CHARSET occupies when displayed. -\[emu-e19.el]" + "Return registry name of CHARSET." + (get charset 'charset-registry) + ) + +(defun charset-width (charset) + "Return number of columns a CHARSET occupies when displayed." 1) (defun charset-direction (charset) "Return the direction of a character of CHARSET by - 0 (left-to-right) or 1 (right-to-left). [emu-e19.el]" + 0 (left-to-right) or 1 (right-to-left)." 0) (defun find-charset-string (str) - "Return a list of charsets in the string. -\[emu-e19.el; Mule emulating function]" + "Return a list of charsets in the string." (if (string-match "[\200-\377]" str) - (list charset-latin-iso8859-1) + '(latin-iso8859-1) )) (defalias 'find-non-ascii-charset-string 'find-charset-string) @@ -76,12 +74,10 @@ "Return a list of charsets 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 charset-latin-iso8859-1) + (goto-char start) + (re-search-forward "[\200-\377]" end t) + ) + '(latin-iso8859-1) )) (defalias 'find-non-ascii-charset-region 'find-charset-region) @@ -197,7 +193,7 @@ find-file-hooks, etc. ;;; (defvar charsets-mime-charset-alist - (list (cons (list charset-ascii) 'us-ascii))) + '(((ascii) . us-ascii))) (defvar default-mime-charset 'iso-8859-1) @@ -210,33 +206,28 @@ find-file-hooks, etc. ) (defun detect-mime-charset-region (start end) - "Return MIME charset for region between START and END. -\[emu-e19.el]" + "Return MIME charset for region between START and END." (if (save-excursion - (save-restriction - (narrow-to-region start end) - (goto-char start) - (re-search-forward "[\200-\377]" nil t) - )) + (goto-char start) + (re-search-forward "[\200-\377]" end t) + ) default-mime-charset 'us-ascii)) (defun encode-mime-charset-region (start end charset) - "Encode the text between START and END as MIME CHARSET. -\[emu-e19.el]" + "Encode the text between START and END as MIME CHARSET." ) (defun decode-mime-charset-region (start end charset) - "Decode the text between START and END as MIME CHARSET. -\[emu-e19.el]" + "Decode the text between START and END as MIME CHARSET." ) (defun encode-mime-charset-string (string charset) - "Encode the STRING as MIME CHARSET. [emu-e19.el]" + "Encode the STRING as MIME CHARSET." string) (defun decode-mime-charset-string (string charset) - "Decode the STRING as MIME CHARSET. [emu-e19.el]" + "Decode the STRING as MIME CHARSET." string) @@ -246,8 +237,8 @@ find-file-hooks, etc. (defun char-charset (char) "Return the character set of char CHAR." (if (< chr 128) - charset-ascii - charset-latin-iso8859-1)) + 'ascii + 'latin-iso8859-1)) (defun char-bytes (char) "Return number of bytes a character in CHAR occupies in a buffer." @@ -257,28 +248,17 @@ find-file-hooks, etc. "Return number of columns a CHAR occupies when displayed." 1) +(defalias 'char-length 'char-bytes) + (defmacro char-next-index (char index) "Return index of character succeeding CHAR whose index is INDEX." (` (1+ index))) -;;; @@ Mule emulating aliases -;;; -;;; You should not use them. - -(defalias 'char-leading-char 'char-charset) - -;;; @@ obsoleted aliases -;;; -;;; You should not use them. - -(defalias 'char-length 'char-bytes) -(defalias 'char-columns 'char-width) - ;;; @ string ;;; -(defalias 'string-columns 'length) +(defalias 'string-width 'length) (defun string-to-char-list (str) (mapcar (function identity) str) @@ -297,10 +277,12 @@ Optional non-nil arg START-COLUMN specifies the starting column. (substring str start-column width) ) -;;; @@ for old MULE emulation +;;; @@ obsoleted aliases ;;; +;;; You should not use them. -(defalias 'string-width 'length) +(defalias 'string-columns 'length) +(make-obsolete 'string-columns 'string-width) ;;; @ end diff --git a/emu-e20.el b/emu-e20.el index 6f51347..4fb7e87 100644 --- a/emu-e20.el +++ b/emu-e20.el @@ -174,6 +174,8 @@ code conversion will not take place." ;;; @ character ;;; +(defalias 'char-length 'char-bytes) + (defmacro char-next-index (char index) "Return index of character succeeding CHAR whose index is INDEX." `(+ index (char-bytes char))) @@ -189,19 +191,10 @@ TABLE defaults to the current buffer's category table." (category-set-mnemonics (char-category-set character)) ) -;;; @@ obsoleted aliases -;;; -;;; You should not use them. - -(defalias 'char-length 'char-bytes) -(defalias 'char-columns 'char-width) - ;;; @ string ;;; -(defalias 'string-columns 'string-width) - (defalias 'sset 'store-substring) (defun string-to-char-list (string) @@ -219,6 +212,13 @@ TABLE defaults to the current buffer's category table." (defalias 'string-to-int-list 'string-to-char-list) +;;; @@ obsoleted aliases +;;; +;;; You should not use them. + +(defalias 'string-columns 'string-width) +(make-obsolete 'string-columns 'string-width) + ;;; @ end ;;; diff --git a/emu-mule.el b/emu-mule.el index eed2bd7..ebcdba4 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -326,7 +326,7 @@ It must be symbol.") ;;; You should not use them. (defalias 'char-length 'char-bytes) -(defalias 'char-columns 'char-width) +;;(defalias 'char-columns 'char-width) ;;; @ string diff --git a/emu-nemacs.el b/emu-nemacs.el index 62826c8..91ee9d5 100644 --- a/emu-nemacs.el +++ b/emu-nemacs.el @@ -30,26 +30,30 @@ ;;; @ character set ;;; -(defconst charset-ascii 0 "Character set of ASCII") -(defconst charset-jisx0208 146 "Character set of JIS X0208-1983") +(put 'ascii + 'charset-description "Character set of ASCII") +(put 'ascii + 'charset-registry "ASCII") + +(put 'japanese-jisx0208 + 'charset-description "Character set of JIS X0208-1983") +(put 'japanese-jisx0208 + 'charset-registry "JISX0208.1983") (defun charset-description (charset) "Return description of CHARSET. [emu-nemacs.el]" - (if (< charset 128) - (documentation-property 'charset-ascii 'variable-documentation) - (documentation-property 'charset-jisx0208 'variable-documentation) - )) + (get charset 'charset-description) + ) (defun charset-registry (charset) "Return registry name of CHARSET. [emu-nemacs.el]" - (if (< charset 128) - "ASCII" - "JISX0208.1983")) + (get charset 'charset-registry) + ) -(defun charset-columns (charset) +(defun charset-width (charset) "Return number of columns a CHARSET occupies when displayed. \[emu-nemacs.el]" - (if (< charset 128) + (if (eq charset 'ascii) 1 2)) @@ -62,7 +66,7 @@ "Return a list of charsets in the string. \[emu-nemacs.el; Mule emulating function]" (if (string-match "[\200-\377]" str) - (list lc-jp) + '(japanese-jisx0208) )) (defalias 'find-non-ascii-charset-string 'find-charset-string) @@ -76,7 +80,7 @@ (goto-char start) (re-search-forward "[\200-\377]" nil t) )) - (list lc-jp) + '(japanese-jisx0208) )) (defalias 'find-non-ascii-charset-region 'find-charset-region) @@ -96,8 +100,8 @@ ;;; @@ for old MULE emulation ;;; -(defconst lc-ascii 0) -(defconst lc-jp 146) +;;(defconst lc-ascii 0) +;;(defconst lc-jp 146) ;;; @ coding system @@ -240,7 +244,7 @@ find-file-hooks, etc. ;;; (defvar charsets-mime-charset-alist - (list (cons (list charset-ascii) 'us-ascii))) + '(((ascii) . us-ascii))) (defvar default-mime-charset 'iso-2022-jp) @@ -316,8 +320,8 @@ find-file-hooks, etc. "Return the character set of char CHR. \[emu-nemacs.el; MULE emulating function]" (if (< chr 128) - charset-ascii - charset-jisx0208)) + 'ascii + 'japanese-jisx0208)) (defun char-bytes (chr) "Return number of bytes CHAR will occupy in a buffer. @@ -331,28 +335,17 @@ find-file-hooks, etc. 1 2)) +(defalias 'char-length 'char-bytes) + (defmacro char-next-index (char index) "Return index of character succeeding CHAR whose index is INDEX." (` (1+ index))) -;;; @@ Old Mule emulating aliases -;;; -;;; You should not use them. - -(defalias 'char-leading-char 'char-charset) - -;;; @@ obsoleted aliases -;;; -;;; You should not use them. - -(defalias 'char-length 'char-bytes) -(defalias 'char-columns 'char-width) - ;;; @ string ;;; -(defalias 'string-columns 'length) +(defalias 'string-width 'length) (defun sref (str idx) "Return the character in STR at index IDX. @@ -410,10 +403,11 @@ Optional non-nil arg START-COLUMN specifies the starting column. (setq to to-prev))) (substring str from to)))) -;;; @@ for Mule emulation +;;; @@ obsoleted aliases ;;; +;;; You should not use them. -(defalias 'string-width 'length) +(defalias 'string-columns 'length) ;;; @ text property emulation