1 ;;; poem-20.el --- poem implementation for Emacs 20 and XEmacs-mule
3 ;; Copyright (C) 1997,1998 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: emulation, compatibility, Mule
8 ;; This file is part of APEL (A Portable Emacs Library).
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 ;; This module requires Emacs 20.0.93, XEmacs 20.3-b5 (with mule)
32 ;;; @ without code-conversion
35 (defmacro as-binary-process (&rest body)
36 `(let (selective-display ; Disable ^M to nl translation.
37 (coding-system-for-read 'binary)
38 (coding-system-for-write 'binary))
41 (defmacro as-binary-input-file (&rest body)
42 `(let ((coding-system-for-read 'binary))
45 (defmacro as-binary-output-file (&rest body)
46 `(let ((coding-system-for-write 'binary))
49 (defun write-region-as-binary (start end filename
50 &optional append visit lockname)
51 "Like `write-region', q.v., but don't encode."
52 (let ((coding-system-for-write 'binary))
53 (write-region start end filename append visit lockname)))
55 (defun insert-file-contents-as-binary (filename
56 &optional visit beg end replace)
57 "Like `insert-file-contents', q.v., but don't code and format conversion.
58 Like `insert-file-contents-literary', but it allows find-file-hooks,
59 automatic uncompression, etc.
61 Namely this function ensures that only format decoding and character
62 code conversion will not take place."
63 (let ((coding-system-for-read 'binary)
65 ;; Returns list of absolute file name and length of data inserted.
66 (insert-file-contents filename visit beg end replace)))
68 (defun insert-file-contents-as-raw-text (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
75 (let ((coding-system-for-read 'raw-text)
77 ;; Returns list of absolute file name and length of data inserted.
78 (insert-file-contents filename visit beg end replace)))
80 (defun write-region-as-raw-text-CRLF (start end filename
81 &optional append visit lockname)
82 "Like `write-region', q.v., but write as network representation."
83 (let ((coding-system-for-write 'raw-text-dos))
84 (write-region start end filename append visit lockname)))
92 ;;; poem-20.el ends here