diff lisp/tl/emu-x20.el @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents 364816949b59
children fe104dbd9147
line wrap: on
line diff
--- a/lisp/tl/emu-x20.el	Mon Aug 13 09:12:43 2007 +0200
+++ b/lisp/tl/emu-x20.el	Mon Aug 13 09:13:56 2007 +0200
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1994,1995,1996,1997 MORIOKA Tomohiko
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: emu-x20.el,v 1.3 1997/01/30 02:22:46 steve Exp $
+;; Version: $Id: emu-x20.el,v 1.4 1997/02/15 22:21:24 steve Exp $
 ;; Keywords: emulation, compatibility, Mule, XEmacs
 
 ;; This file is part of XEmacs.
@@ -28,12 +28,6 @@
 (require 'cyrillic)
 (require 'emu-xemacs)
 
-(defvar xemacs-beta-version
-  (if (string-match "(beta\\([0-9]+\\))" emacs-version)
-      (string-to-number
-       (substring emacs-version (match-beginning 1)(match-end 1))
-       )))
-
 
 ;;; @ coding-system
 ;;;
@@ -49,6 +43,7 @@
 
 (defmacro as-binary-process (&rest body)
   `(let (selective-display	; Disable ^M to nl translation.
+	 (file-coding-system 'no-conversion)
 	 process-input-coding-system
 	 process-output-coding-system)
      ,@body))
@@ -57,6 +52,25 @@
   `(let ((file-coding-system-for-read 'no-conversion))
      ,@body))
 
+(defmacro as-binary-output-file (&rest body)
+  `(let ((file-coding-system 'no-conversion))
+     ,@body))
+
+
+;;; @ binary access
+;;;
+
+(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 ((file-coding-system-for-read 'no-conversion))
+    (insert-file-contents-literally filename visit beg end replace)
+    ))
+
 
 ;;; @ MIME charset
 ;;;
@@ -159,25 +173,10 @@
 ;;; @ character
 ;;;
 
-;; (defun char-bytes (chr) 1)
-
-;; (defun char-length (character)
-;;   "Return number of elements a CHARACTER occupies in a string or buffer.
-;; \[emu-x20.el]"
-;;   1)
-
-;; (defun char-columns (character)
-;;   "Return number of columns a CHARACTER occupies when displayed.
-;; \[emu-x20.el]"
-;;   (charset-columns (char-charset character))
-;;   )
-
 ;;; @@ Mule emulating aliases
 ;;;
 ;;; You should not use them.
 
-;;(defalias 'char-width 'char-columns)
-
 (defalias 'char-leading-char 'char-charset)
 
 (defun char-category (character)
@@ -195,35 +194,10 @@
 ;;; @ string
 ;;;
 
-;; (defun string-columns (string)
-;;   "Return number of columns STRING occupies when displayed.
-;; \[emu-x20.el]"
-;;   (let ((col 0)
-;;         (len (length string))
-;;         (i 0))
-;;     (while (< i len)
-;;       (setq col (+ col (char-columns (aref string i))))
-;;       (setq i (1+ i))
-;;       )
-;;     col))
-
-;;(defalias 'string-width 'string-columns)
-
 (defun string-to-int-list (str)
   (mapcar #'char-int str)
   )
 
-;;(defalias 'sref 'aref)
-
-;; (defun truncate-string (str width &optional start-column)
-;;   "Truncate STR to fit in WIDTH columns.
-;; Optional non-nil arg START-COLUMN specifies the starting column.
-;; \[emu-x20.el; Mule 2.3 emulating function]"
-;;   (or start-column
-;;       (setq start-column 0))
-;;   (substring str start-column width)
-;;   )
-
 
 ;;; @ end
 ;;;