(open-network-stream-as-binary): New function.
* poem-e20_2.el (insert-file-contents-as-specified-coding-system):
New function.
* poem-20.el, poem-ltn1.el, poem-nemacs.el, poem-om.el
(write-region-as-specified-coding-system): New function.
(insert-file-contents-as-specified-coding-system): New function.
+1998-12-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * poem-20.el, poem-ltn1.el, poem-nemacs.el, poem-om.el
+ (open-network-stream-as-binary): New function.
+
+ * poem-e20_2.el (insert-file-contents-as-specified-coding-system):
+ New function.
+
+ * poem-20.el, poem-ltn1.el, poem-nemacs.el, poem-om.el
+ (write-region-as-specified-coding-system): New function.
+ (insert-file-contents-as-specified-coding-system): New function.
+
1998-12-01 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* poem-xm.el: If coding-system `iso-2022-jp-dos' unifies JIS X
(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
;;;
(set-buffer-multibyte flag))))
+;;; @ 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 ((flag enable-multibyte-characters)
+ (coding-system-for-read (car (reverse args)))
+ format-alist)
+ (prog1
+ (apply 'insert-file-contents filename
+ (nreverse (cdr (nreverse args))))
+ (set-buffer-multibyte flag))))
+
+
;;; @ end
;;;
(defalias 'insert-file-contents-as-raw-text 'insert-file-contents)
+(defun open-network-stream-as-binary (name buffer host service)
+ "Like `open-network-stream', q.v., but don't code conversion."
+ (let ((emx-binary-mode t))
+ (open-network-stream name buffer host service)))
+
+
+;;; @ with code-conversion (but actually it might be not done)
+;;;
+
+(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."
+ (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 (jka-compr-compression-info-list jam-zcat-filename-list)
+ (apply 'write-region start end filename
+ (nreverse (cdr (nreverse args))))))
+
;;; @ character
;;;
(write-region-as-binary (point-min)(point-max)
filename append visit))))
+(defun open-network-stream-as-binary (name buffer host service)
+ "Like `open-network-stream', q.v., but don't code conversion."
+ (let ((process (open-network-stream name buffer host service)))
+ (set-process-kanji-code process 0)
+ process))
+
+
+;;; @ 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 ((kanji-fileio-code (car (reverse args)))
+ kanji-expected-code)
+ (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 ((kanji-fileio-code (car (reverse args)))
+ jka-compr-compression-info-list jam-zcat-filename-list)
+ (apply 'write-region start end filename
+ (nreverse (cdr (nreverse args))))))
+
;;; @ buffer representation
;;;
filename append visit))))
))
+(defun open-network-stream-as-binary (name buffer host service)
+ "Like `open-network-stream', q.v., but don't code conversion."
+ (let ((process (open-network-stream name buffer host service)))
+ (set-process-coding-system process *noconv* *noconv*)
+ process))
+
+
+;;; @ 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 ((file-coding-system-for-read (car (reverse args))))
+ (apply 'insert-file-contents filename (nreverse (cdr (nreverse args))))))
+
+(cond
+ (running-emacs-19_29-or-later
+ ;; for MULE 2.3 based on Emacs 19.34.
+ (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 ((file-coding-system (car (reverse args)))
+ jka-compr-compression-info-list jam-zcat-filename-list)
+ (apply 'write-region start end filename
+ (nreverse (cdr (nreverse args))))))
+ )
+ (t
+ ;; for MULE 2.3 based on Emacs 19.28.
+ (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 ((code (car (reverse args)))
+ (args (nreverse (cdr (nreverse args))))
+ jka-compr-compression-info-list jam-zcat-filename-list)
+ (write-region start end filename (car args) (car (cdr args)) code)))
+ ))
+
;;; @ buffer representation
;;;