X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=poem-xm.el;h=4c0ac8d05c6917d224da9c2ceaa0e43c44ea247f;hb=7676472c8a29e8435bd7937f1aa95d6db9603f0b;hp=58ab3e2800c4bca27120ce6d5262ac601b10be66;hpb=aa1db75f701dc8e5b11678451fa322e893a25be8;p=elisp%2Fapel.git diff --git a/poem-xm.el b/poem-xm.el index 58ab3e2..4c0ac8d 100644 --- a/poem-xm.el +++ b/poem-xm.el @@ -1,4 +1,4 @@ -;;; poem-xm.el --- poem implementation for XEmacs-mule +;;; poem-xm.el --- poem module for XEmacs-mule; -*-byte-compile-dynamic: t;-*- ;; Copyright (C) 1998 Free Software Foundation, Inc. @@ -24,6 +24,8 @@ ;;; Code: +(eval-when-compile + (require 'poe)) (require 'poem-20) @@ -34,6 +36,9 @@ (and (coding-system-property 'iso-2022-jp 'input-charset-conversion) (copy-coding-system 'iso-2022-7bit 'iso-2022-jp)) +(and (coding-system-property 'iso-2022-jp-dos 'input-charset-conversion) + (copy-coding-system 'iso-2022-7bit-dos 'iso-2022-jp-dos)) + ;; Redefine if -{dos|mac|unix} is not found. (or (find-coding-system 'raw-text-dos) (copy-coding-system 'no-conversion-dos 'raw-text-dos)) @@ -61,6 +66,13 @@ mnemonic "ISO7/SS2" eol-type nil))) +(or (find-coding-system 'gb2312-dos) + (copy-coding-system 'cn-gb-2312-dos 'gb2312-dos)) +(or (find-coding-system 'gb2312-mac) + (copy-coding-system 'cn-gb-2312-mac 'gb2312-mac)) +(or (find-coding-system 'gb2312-unix) + (copy-coding-system 'cn-gb-2312-unix 'gb2312-unix)) + (or (find-coding-system 'euc-kr-dos) (make-coding-system 'euc-kr 'iso2022 @@ -90,6 +102,36 @@ ;; ) +;;; @ 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) + (jam-zcat-filename-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))))) + + ;;; @ buffer representation ;;; @@ -134,7 +176,7 @@ but the contents viewed as characters do change. ;;; @ string ;;; -(defun string-to-int-list (str) +(defun-maybe string-to-int-list (str) (mapcar #'char-int str)) (defalias 'looking-at-as-unibyte 'looking-at)