From: morioka Date: Fri, 17 Apr 1998 00:28:41 +0000 (+0000) Subject: Separate Emacs 20.1 and 20.2 depended definitions from emu-e20.el to X-Git-Tag: apel-8_3~19 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3f461e470de396ceb05af59960de6e7d095223f6;p=elisp%2Fapel.git Separate Emacs 20.1 and 20.2 depended definitions from emu-e20.el to emu-e20_2.el. --- diff --git a/EMU-ELS b/EMU-ELS index ea99b9a..7a63127 100644 --- a/EMU-ELS +++ b/EMU-ELS @@ -1,6 +1,6 @@ ;;; -*-Emacs-Lisp-*- ;;; -;;; $Id: EMU-ELS,v 1.5 1998-04-16 23:07:34 morioka Exp $ +;;; $Id: EMU-ELS,v 1.6 1998-04-17 00:28:38 morioka Exp $ ;;; (setq emu-modules @@ -19,11 +19,12 @@ (cons 'emu-xemacs (if (featurep 'mule) '(emu-20 emu-x20) ; for XEmacs with MULE - '(emu-latin1))) ; for XEmacs without MULE + '(emu-latin1) ; for XEmacs without MULE + )) ) ((featurep 'mule) ;; for Emacs 20.1 or later - '(emu-20 emu-e19 emu-e20) + '(emu-20 emu-e19 emu-e20 emu-e20_2) ) ((boundp 'MULE) ;; for MULE 1.* and MULE 2.* diff --git a/emu-e20.el b/emu-e20.el index bb3f994..3c606d1 100644 --- a/emu-e20.el +++ b/emu-e20.el @@ -72,67 +72,9 @@ in the region between START and END." (defalias 'set-process-input-coding-system 'set-process-coding-system) -;;; @ binary access -;;; - -(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 ((flag enable-multibyte-characters) - (coding-system-for-read 'binary) - format-alist) - (insert-file-contents filename visit beg end replace) - (setq enable-multibyte-characters flag) - )) - -(defalias 'insert-binary-file-contents 'insert-file-contents-as-binary) -(make-obsolete 'insert-binary-file-contents 'insert-file-contents-as-binary) - -(defalias 'insert-binary-file-contents-literally - 'insert-file-contents-literally) - - ;;; @ MIME charset ;;; -(defsubst encode-mime-charset-region (start end charset) - "Encode the text between START and END as MIME CHARSET." - (let (cs) - (if (and enable-multibyte-characters - (setq cs (mime-charset-to-coding-system charset))) - (encode-coding-region start end cs) - ))) - -(defsubst decode-mime-charset-region (start end charset) - "Decode the text between START and END as MIME CHARSET." - (let (cs) - (if (and enable-multibyte-characters - (setq cs (mime-charset-to-coding-system charset))) - (decode-coding-region start end cs) - ))) - -(defsubst encode-mime-charset-string (string charset) - "Encode the STRING as MIME CHARSET." - (let (cs) - (if (and enable-multibyte-characters - (setq cs (mime-charset-to-coding-system charset))) - (encode-coding-string string cs) - string))) - -(defsubst decode-mime-charset-string (string charset) - "Decode the STRING as MIME CHARSET." - (let (cs) - (if (and enable-multibyte-characters - (setq cs (mime-charset-to-coding-system charset))) - (decode-coding-string string cs) - string))) - - (defvar charsets-mime-charset-alist '(((ascii) . us-ascii) ((ascii latin-iso8859-1) . iso-8859-1) @@ -174,12 +116,6 @@ code conversion will not take place." ;;; @ character ;;; -(defalias 'char-length 'char-bytes) - -(defmacro char-next-index (char index) - "Return index of character succeeding CHAR whose index is INDEX." - `(+ index (char-bytes char))) - ;;; @@ Mule emulating aliases ;;; ;;; You should not use them. @@ -192,37 +128,10 @@ TABLE defaults to the current buffer's category table." ) -;;; @ string -;;; - -(defalias 'sset 'store-substring) - -(defun string-to-char-list (string) - "Return a list of which elements are characters in the STRING." - (let* ((len (length string)) - (i 0) - l chr) - (while (< i len) - (setq chr (sref string i)) - (setq l (cons chr l)) - (setq i (+ i (char-bytes chr))) - ) - (nreverse l) - )) - -(defalias 'string-to-int-list 'string-to-char-list) - -;;; @@ obsoleted aliases -;;; -;;; You should not use them. - -(defalias 'string-columns 'string-width) -(make-obsolete 'string-columns 'string-width) - - ;;; @ end ;;; +(require 'emu-e20_2) (require 'emu-20) (provide 'emu-e20) diff --git a/emu-e20_2.el b/emu-e20_2.el new file mode 100644 index 0000000..4c1ceb5 --- /dev/null +++ b/emu-e20_2.el @@ -0,0 +1,135 @@ +;;; emu-e20_2.el --- emu API implementation for Emacs 20.1 and 20.2 + +;; Copyright (C) 1996,1997,1998 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Keywords: emulation, compatibility, Mule + +;; This file is part of emu. + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; 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. + +;;; Commentary: + +;; This module requires Emacs 20.1 and 20.2. + +;;; Code: + +;;; @ binary access +;;; + +(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 ((flag enable-multibyte-characters) + (coding-system-for-read 'binary) + format-alist) + (insert-file-contents filename visit beg end replace) + (setq enable-multibyte-characters flag) + )) + +(defalias 'insert-binary-file-contents 'insert-file-contents-as-binary) +(make-obsolete 'insert-binary-file-contents 'insert-file-contents-as-binary) + +(defalias 'insert-binary-file-contents-literally + 'insert-file-contents-literally) + + +;;; @ MIME charset +;;; + +(defsubst encode-mime-charset-region (start end charset) + "Encode the text between START and END as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset))) + (encode-coding-region start end cs) + ))) + +(defsubst decode-mime-charset-region (start end charset) + "Decode the text between START and END as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset))) + (decode-coding-region start end cs) + ))) + +(defsubst encode-mime-charset-string (string charset) + "Encode the STRING as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset))) + (encode-coding-string string cs) + string))) + +(defsubst decode-mime-charset-string (string charset) + "Decode the STRING as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset))) + (decode-coding-string string cs) + string))) + + +;;; @ character +;;; + +(defalias 'char-length 'char-bytes) + +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + `(+ index (char-bytes char))) + + +;;; @ string +;;; + +(defalias 'sset 'store-substring) + +(defun string-to-char-list (string) + "Return a list of which elements are characters in the STRING." + (let* ((len (length string)) + (i 0) + l chr) + (while (< i len) + (setq chr (sref string i)) + (setq l (cons chr l)) + (setq i (+ i (char-bytes chr))) + ) + (nreverse l) + )) + +(defalias 'string-to-int-list 'string-to-char-list) + +;;; @@ obsoleted aliases +;;; +;;; You should not use them. + +(defalias 'string-columns 'string-width) +(make-obsolete 'string-columns 'string-width) + + +;;; @ end +;;; + +(provide 'emu-e20_2) + +;;; emu-e20_2.el ends here