-(or (fboundp 'buffer-substring-no-properties)
- (defun buffer-substring-no-properties (beg end)
- "Return the text from BEG to END, without text properties, as a string."
- (let ((string (buffer-substring beg end)))
- (tl:set-text-properties 0 (length string) nil string)
- string))
- )
-
-(cond ((or running-emacs-19_29-or-later running-xemacs)
- ;; for Emacs 19.29 or later and XEmacs
- (defalias 'tl:read-string 'read-string)
+ (defun char-category (character)
+ "Return string of category mnemonics for CHAR in TABLE.
+CHAR can be any multilingual character
+TABLE defaults to the current buffer's category table."
+ (mapconcat (lambda (chr)
+ (if (integerp chr)
+ (char-to-string (int-char chr))
+ (char-to-string chr)))
+ ;; `char-category-list' returns a list of
+ ;; characters in XEmacs 21.2.25 and later,
+ ;; otherwise integers.
+ (char-category-list character)
+ ""))
+ )
+ ((>= emacs-major-version 20) ; for Emacs 20
+ (defalias 'insert-binary-file-contents-literally
+ 'insert-file-contents-literally)
+
+ ;; old Mule emulating aliases
+ (defun char-category (character)
+ "Return string of category mnemonics for CHAR in TABLE.
+CHAR can be any multilingual character
+TABLE defaults to the current buffer's category table."
+ (category-set-mnemonics (char-category-set character)))
+ )
+ (t ; for MULE 1.* and 2.*
+ (require 'emu-mule)
+ ))
+ )
+ ((boundp 'NEMACS)
+ ;; for Nemacs and Nepoch
+
+ ;; old MULE emulation
+ (defconst *noconv* 0)
+ (defconst *sjis* 1)
+ (defconst *junet* 2)
+ (defconst *ctext* 2)
+ (defconst *internal* 3)
+ (defconst *euc-japan* 3)
+
+ (defun code-convert-string (str ic oc)
+ "Convert code in STRING from SOURCE code to TARGET code,
+On successful conversion, returns the result string,
+else returns nil."
+ (if (not (eq ic oc))
+ (convert-string-kanji-code str ic oc)
+ 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."
+ (if (/= ic oc)
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (convert-region-kanji-code beg end ic oc)))
+ ))