-;;; poem-20.el --- poem implementation for Emacs 20 and XEmacs-mule
+;;; -*-byte-compile-dynamic: t;-*-
+;;; poem-20.el --- poem submodule for Emacs 20 and XEmacs-mule
;; Copyright (C) 1997,1998 Free Software Foundation, Inc.
(defun write-region-as-binary (start end filename
&optional append visit lockname)
"Like `write-region', q.v., but don't encode."
- (let ((coding-system-for-write 'binary))
+ (let ((coding-system-for-write 'binary)
+ jka-compr-compression-info-list jam-zcat-filename-list)
(write-region start end filename append visit lockname)))
-(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)
- ;; Returns list of absolute file name and length of data inserted.
- (insert-file-contents filename visit beg end replace)))
+;; `insert-file-contents-literally' of Emacs 20 supports
+;; `file-name-handler-alist'.
+(defalias 'insert-file-contents-as-binary 'insert-file-contents-literally)
(defun insert-file-contents-as-raw-text (filename
&optional visit beg end replace)
(let ((coding-system-for-write 'raw-text-dos))
(write-region start end filename append visit lockname)))
+(defun open-network-stream-as-binary (name buffer host service)
+ "Like `open-network-stream', q.v., but don't code conversion."
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (open-network-stream name buffer host service)))
+
+
+;;; @ with code-conversion
+;;;
+
+(defun insert-file-contents-as-specified-coding-system (filename &rest args)
+ "Like `insert-file-contents', q.v., but code convert by the specified
+coding-system. ARGS the optional arguments are passed to
+`insert-file-contents' except for the last element. The last element of
+ARGS must be a coding-system."
+ (let ((coding-system-for-read (car (reverse args)))
+ format-alist)
+ (apply 'insert-file-contents filename (nreverse (cdr (nreverse args))))))
+
+(defun write-region-as-specified-coding-system (start end filename
+ &rest args)
+ "Like `write-region', q.v., but code convert by the specified coding-system.
+ARGS the optional arguments are passed to `write-region' except for the last
+element. The last element of ARGS must be a coding-system."
+ (let ((coding-system-for-write (car (reverse args)))
+ jka-compr-compression-info-list jam-zcat-filename-list)
+ (apply 'write-region start end filename
+ (nreverse (cdr (nreverse args))))))
+
;;; @ end
;;;