;;; @ 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))
"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)
(goto-char start)
(re-search-forward "[\200-\377]" nil t)
))
- (list lc-jp)
+ '(japanese-jisx0208)
))
(defalias 'find-non-ascii-charset-region 'find-charset-region)
;;; @@ for old MULE emulation
;;;
-(defconst lc-ascii 0)
-(defconst lc-jp 146)
+;;(defconst lc-ascii 0)
+;;(defconst lc-jp 146)
;;; @ coding system
;;;
(defvar charsets-mime-charset-alist
- (list (cons (list charset-ascii) 'us-ascii)))
+ '(((ascii) . us-ascii)))
(defvar default-mime-charset 'iso-2022-jp)
"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.
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.
(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