X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=emu-x20.el;h=87906972b7105bccfc2c7fc42fddf892ea36b68e;hb=aa35c611ba440a528f9b5c348d3c2c673137c92b;hp=368c55b0d81a9057ccd41f9062f481d59cf8b5f9;hpb=021e63bffbfe04eebf916a8ceec43603cb40a2f7;p=elisp%2Fapel.git diff --git a/emu-x20.el b/emu-x20.el index 368c55b..8790697 100644 --- a/emu-x20.el +++ b/emu-x20.el @@ -3,7 +3,6 @@ ;; Copyright (C) 1994,1995,1996,1997,1998 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko -;; Version: $Id: emu-x20.el,v 7.69 1998/01/10 18:00:57 morioka Exp $ ;; Keywords: emulation, compatibility, Mule, XEmacs ;; This file is part of emu. @@ -29,8 +28,8 @@ ;;; Code: -(require 'emu-xemacs) -(require 'emu-20) +;; (require 'emu-xemacs) +;; (require 'emu-20) (and (coding-system-property 'iso-2022-jp 'input-charset-conversion) @@ -40,25 +39,45 @@ ;;; @ binary access ;;; -(defun insert-binary-file-contents (filename &optional visit beg end replace) - "Like `insert-file-contents', q.v., but don't code and format conversion." +(defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. + +Namely this function ensures that only format decoding and character +code conversion will not take place." (let ((coding-system-for-read 'binary) format-alist) (insert-file-contents filename visit beg end replace) )) +(define-obsolete-function-alias 'insert-binary-file-contents + 'insert-file-contents-as-binary) + +(defun insert-binary-file-contents-literally (filename + &optional visit beg end replace) + "Like `insert-file-contents-literally', q.v., but don't code conversion. +A buffer may be modified in several ways after reading into the buffer due +to advanced Emacs features, such as file-name-handlers, format decoding, +find-file-hooks, etc. + This function ensures that none of these modifications will take place." + (let ((coding-system-for-read 'binary)) + (insert-file-contents-literally filename visit beg end replace) + )) + ;;; @ MIME charset ;;; -(defsubst encode-mime-charset-region (start end charset) +(defun encode-mime-charset-region (start end charset) "Encode the text between START and END as MIME CHARSET." (let ((cs (mime-charset-to-coding-system charset))) (if cs (encode-coding-region start end cs) ))) -(defsubst decode-mime-charset-region (start end charset) +(defun decode-mime-charset-region (start end charset) "Decode the text between START and END as MIME CHARSET." (let ((cs (mime-charset-to-coding-system charset))) (if cs @@ -125,11 +144,15 @@ ;;; @ character ;;; +(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) +;;(defalias 'char-leading-char 'char-charset) (defun char-category (character) "Return string of category mnemonics for CHAR in TABLE.