X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fapel.git;a=blobdiff_plain;f=poem-xm.el;h=88cf3885675521658f18c78e831429a8f6f21318;hp=e9516b8bf820443af280ae634a28ac2ca1bcb284;hb=8fea4843a926e356bb5e6fb7850d1a05bde1f0ca;hpb=d9868ca85eae40b6a307bf5a3fca22f0f066169c diff --git a/poem-xm.el b/poem-xm.el index e9516b8..88cf388 100644 --- a/poem-xm.el +++ b/poem-xm.el @@ -1,8 +1,8 @@ ;;; poem-xm.el --- poem module for XEmacs-mule; -*-byte-compile-dynamic: t;-*- -;; Copyright (C) 1998 Free Software Foundation, Inc. +;; Copyright (C) 1998,1999,2002,2003,2005 Free Software Foundation, Inc. -;; Author: MORIOKA Tomohiko +;; Author: MORIOKA Tomohiko ;; Keywords: emulation, compatibility, Mule ;; This file is part of APEL (A Portable Emacs Library). @@ -19,104 +19,13 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: -(require 'poem-20) - - -;;; @ fix coding-system definition -;;; - -;; It seems not bug, but I can not permit it... -(and (coding-system-property 'iso-2022-jp 'input-charset-conversion) - (copy-coding-system 'iso-2022-7bit 'iso-2022-jp)) - -;; Redefine if -{dos|mac|unix} is not found. -(or (find-coding-system 'raw-text-dos) - (copy-coding-system 'no-conversion-dos 'raw-text-dos)) -(or (find-coding-system 'raw-text-mac) - (copy-coding-system 'no-conversion-mac 'raw-text-mac)) -(or (find-coding-system 'raw-text-unix) - (copy-coding-system 'no-conversion-unix 'raw-text-unix)) - -(or (find-coding-system 'ctext-dos) - (make-coding-system - 'ctext 'iso2022 - "Coding-system used in X as Compound Text Encoding." - '(charset-g0 ascii charset-g1 latin-iso8859-1 - eol-type nil - mnemonic "CText"))) - -(or (find-coding-system 'iso-2022-jp-2-dos) - (make-coding-system - 'iso-2022-jp-2 'iso2022 - "ISO-2022 coding system using SS2 for 96-charset in 7-bit code." - '(charset-g0 ascii - charset-g2 t ;; unspecified but can be used later. - seven t - short t - mnemonic "ISO7/SS2" - eol-type nil))) - -(or (find-coding-system 'euc-kr-dos) - (make-coding-system - 'euc-kr 'iso2022 - "Coding-system of Korean EUC (Extended Unix Code)." - '(charset-g0 ascii charset-g1 korean-ksc5601 - mnemonic "ko/EUC" - eol-type nil))) - -;; (when (= (function-max-args 'coding-system-list) 0) -;; (or (fboundp 'coding-system-list-internal) -;; (fset 'coding-system-list-internal -;; (symbol-function 'coding-system-list))) -;; (defun coding-system-list (&optional base-only) -;; "Return a list of all existing coding systems. -;; If optional arg BASE-ONLY is non-nil, only base coding systems are listed." -;; (if base-only -;; (let (dest -;; (rest (coding-system-list-internal)) -;; cs) -;; (while rest -;; (setq cs (coding-system-name (coding-system-base (pop rest)))) -;; (or (memq cs dest) -;; (push cs dest)) -;; ) -;; dest) -;; (coding-system-list-internal))) -;; ) - - -;;; @ without code-conversion -;;; - -(defun insert-file-contents-as-binary (filename - &optional visit beg end replace) - "Like `insert-file-contents', but only reads in the file literally. -A buffer may be modified in several ways after reading into the buffer, -to Emacs features such as format decoding, character code -conversion, find-file-hooks, automatic uncompression, etc. - -This function ensures that none of these modifications will take place." - (let ((format-alist nil) - (after-insert-file-functions nil) - (coding-system-for-read 'binary) - (coding-system-for-write 'binary) - (jka-compr-compression-info-list nil) - (find-buffer-file-type-function - (if (fboundp 'find-buffer-file-type) - (symbol-function 'find-buffer-file-type) - nil))) - (unwind-protect - (progn - (fset 'find-buffer-file-type (lambda (filename) t)) - (insert-file-contents filename visit beg end replace)) - (if find-buffer-file-type-function - (fset 'find-buffer-file-type find-buffer-file-type-function) - (fmakunbound 'find-buffer-file-type))))) +(eval-when-compile + (require 'poe)) ;;; @ buffer representation @@ -136,7 +45,7 @@ but the contents viewed as characters do change. ;;; ;; avoid bug of XEmacs -(or (integerp (cdr (split-char ?a))) +(or (integerp (car (cdr (split-char ?a)))) (defun split-char (char) "Return list of charset and one or two position-codes of CHAR." (let ((charset (char-charset char))) @@ -159,6 +68,15 @@ but the contents viewed as characters do change. "Return index of character succeeding CHAR whose index is INDEX." `(1+ ,index)) +(if (not (fboundp 'char-length)) + (defalias 'char-length + (lambda (char) + "Return number of bytes a CHARACTER occupies in a string or buffer. +It always returns 1 in XEmacs. It is for compatibility with MULE 2.3." + 1))) + +(defalias-maybe 'char-valid-p 'characterp) + ;;; @ string ;;; @@ -166,12 +84,16 @@ but the contents viewed as characters do change. (defun-maybe string-to-int-list (str) (mapcar #'char-int str)) +(defun-maybe string-to-char-list (str) + (mapcar #'identity str)) + (defalias 'looking-at-as-unibyte 'looking-at) ;;; @ end ;;; -(provide 'poem-xm) +(require 'product) +(product-provide (provide 'poem-xm) (require 'apel-ver)) ;;; poem-xm.el ends here