1 ;;; -*-byte-compile-dynamic: t;-*-
2 ;;; pces-e20_2.el --- pces implementation for Emacs 20.1 and 20.2
4 ;; Copyright (C) 1996,1997,1998,1999 Free Software Foundation, Inc.
6 ;; Author: MORIOKA Tomohiko <tomo@m17n.org>
7 ;; Keywords: emulation, compatibility, Mule
9 ;; This file is part of APEL (A Portable Emacs Library).
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
16 ;; This program is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;; General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
28 ;; This module requires Emacs 20.1 and 20.2.
32 ;;; @ without code-conversion
35 (defun insert-file-contents-as-binary (filename
36 &optional visit beg end replace)
37 "Like `insert-file-contents', q.v., but don't code and format conversion.
38 Like `insert-file-contents-literary', but it allows find-file-hooks,
39 automatic uncompression, etc.
41 Namely this function ensures that only format decoding and character
42 code conversion will not take place."
43 (let ((flag enable-multibyte-characters)
44 (coding-system-for-read 'binary)
47 ;; Returns list absolute file name and length of data inserted.
48 (insert-file-contents filename visit beg end replace)
49 ;; This operation does not change the length.
50 (set-buffer-multibyte flag))))
52 (defun insert-file-contents-as-raw-text (filename
53 &optional visit beg end replace)
54 "Like `insert-file-contents', q.v., but don't code and format conversion.
55 Like `insert-file-contents-literary', but it allows find-file-hooks,
56 automatic uncompression, etc.
57 Like `insert-file-contents-as-binary', but it converts line-break
59 (let ((flag enable-multibyte-characters)
60 (coding-system-for-read 'raw-text)
63 ;; Returns list absolute file name and length of data inserted.
64 (insert-file-contents filename visit beg end replace)
65 ;; This operation does not change the length.
66 (set-buffer-multibyte flag))))
68 (defun insert-file-contents-as-raw-text-CRLF (filename
69 &optional visit beg end replace)
70 "Like `insert-file-contents', q.v., but don't code and format conversion.
71 Like `insert-file-contents-literary', but it allows find-file-hooks,
72 automatic uncompression, etc.
73 Like `insert-file-contents-as-binary', but it converts line-break code
75 (let ((flag enable-multibyte-characters)
76 (coding-system-for-read 'raw-text-dos)
79 ;; Returns list absolute file name and length of data inserted.
80 (insert-file-contents filename visit beg end replace)
81 ;; This operation does not change the length.
82 (set-buffer-multibyte flag))))
84 (defun find-file-noselect-as-binary (filename &optional nowarn rawfile)
85 "Like `find-file-noselect', q.v., but don't code and format conversion."
86 (let ((flag enable-multibyte-characters)
87 (coding-system-for-read 'binary)
91 (set-buffer (find-file-noselect filename nowarn rawfile))
92 (set-buffer-multibyte flag)))))
94 (defun find-file-noselect-as-raw-text (filename &optional nowarn rawfile)
95 "Like `find-file-noselect', q.v., but it does not code and format conversion
96 except for line-break code."
97 (let ((flag enable-multibyte-characters)
98 (coding-system-for-read 'raw-text)
102 (set-buffer (find-file-noselect filename nowarn rawfile))
103 (set-buffer-multibyte flag)))))
105 (defun find-file-noselect-as-raw-text-CRLF (filename &optional nowarn rawfile)
106 "Like `find-file-noselect', q.v., but it does not code and format conversion
107 except for line-break code."
108 (let ((flag enable-multibyte-characters)
109 (coding-system-for-read 'raw-text-dos)
113 (set-buffer (find-file-noselect filename nowarn rawfile))
114 (set-buffer-multibyte flag)))))
117 ;;; @ with code-conversion
120 (defun insert-file-contents-as-coding-system
121 (coding-system filename &optional visit beg end replace)
122 "Like `insert-file-contents', q.v., but CODING-SYSTEM the first arg will
123 be applied to `coding-system-for-read'."
124 (let ((flag enable-multibyte-characters)
125 (coding-system-for-read coding-system)
128 (insert-file-contents filename visit beg end replace)
129 (set-buffer-multibyte flag))))
131 (defun find-file-noselect-as-coding-system
132 (coding-system filename &optional nowarn rawfile)
133 "Like `find-file-noselect', q.v., but CODING-SYSTEM the first arg will
134 be applied to `coding-system-for-read'."
135 (let ((flag enable-multibyte-characters)
136 (coding-system-for-read coding-system)
140 (set-buffer (find-file-noselect filename nowarn rawfile))
141 (set-buffer-multibyte flag)))))
148 (product-provide (provide 'pces-e20_2) (require 'apel-ver))
150 ;;; pces-e20_2.el ends here