Skip to content

Commit

Permalink
* poem-20.el (write-region-as-binary): Bind `jam-zcat-filename-list' …
Browse files Browse the repository at this point in the history
…with nil.

* poem-xm.el (insert-file-contents-as-binary): Likewise.

* poem.el: Require `tcp' if the function `open-network-stream' does not exist.
  • Loading branch information
yamaoka committed Dec 8, 1998
1 parent a443e90 commit fbbda40
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 213 deletions.
31 changes: 0 additions & 31 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
1998-12-14 Katsumi Yamaoka <yamaoka@jpl.org>

* poem-20.el, poem-e20_2.el, poem-ltn1.el, poem-nemacs.el, poem-om.el
(find-file-noselect-as-coding-system): Renamed from
`find-file-noselect-as-specified-coding-system'.

* poem-e20_2.el (insert-file-contents-as-coding-system): Renamed
from `insert-file-contents-as-specified-coding-system'.

* poem-20.el, poem-ltn1.el, poem-nemacs.el, poem-om.el
(write-region-as-coding-system): Renamed from
`write-region-as-specified-coding-system'.
(insert-file-contents-as-coding-system): Renamed from
`insert-file-contents-as-specified-coding-system'.

1998-12-09 Katsumi Yamaoka <yamaoka@jpl.org>

* poem-20.el, poem-e20_2.el, poem-ltn1.el, poem-nemacs.el, poem-om.el
(find-file-noselect-as-binary): New function.
(find-file-noselect-as-raw-text): New function.
(find-file-noselect-as-specified-coding-system): New function.

* poem-nemacs.el (insert-file-contents-as-binary): Call
`insert-file-contents' with only two args - FILENAME and VISIT.
(insert-file-contents-as-raw-text): Likewise.
(insert-file-contents-as-specified-coding-system): Likewise.

1998-12-09 Yuuichi Teranishi <teranisi@gohome.org>

* poe-18.el (make-directory-internal): Rewrite.

1998-12-08 Katsumi Yamaoka <yamaoka@jpl.org>

* poem-20.el (write-region-as-binary): Bind
Expand Down
9 changes: 5 additions & 4 deletions poe-18.el
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ If NEW is a string, that is the `use instead' message."
(defun make-directory-internal (dirname)
"Create a directory. One argument, a file name string.
\[poe-18.el; EMACS 19 emulating function]"
(let ((dir (expand-file-name dirname)))
(if (file-exists-p dir)
(error "Creating directory: %s is already exist" dir)
(call-process "mkdir" nil nil nil dir))))
(if (file-exists-p dirname)
(error "Creating directory: %s is already exist" dirname)
(if (not (= (call-process "mkdir" nil nil nil dirname) 0))
(error "Creating directory: no such file or directory, %s" dirname)
)))

(defun make-directory (dir &optional parents)
"Create the directory DIR and any nonexistent parent dirs.
Expand Down
50 changes: 16 additions & 34 deletions poem-20.el
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,6 @@ code."
(let ((coding-system-for-write 'raw-text-dos))
(write-region start end filename append visit lockname)))

(defun find-file-noselect-as-binary (filename &optional nowarn rawfile)
"Like `find-file-noselect', q.v., but don't code and format conversion."
(let ((coding-system-for-write 'binary)
format-alist)
(find-file-noselect filename nowarn rawfile)))

(defun find-file-noselect-as-raw-text (filename &optional nowarn rawfile)
"Like `find-file-noselect', q.v., but it does not code and format conversion
except for line-break code."
(let ((coding-system-for-read 'raw-text)
format-alist)
(find-file-noselect filename nowarn rawfile)))

(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)
Expand All @@ -99,29 +86,24 @@ except for line-break code."
;;; @ with code-conversion
;;;

(defun insert-file-contents-as-coding-system
(filename coding-system &optional visit beg end replace)
"Like `insert-file-contents', q.v., but CODING-SYSTEM the second arg will
be applied to `coding-system-for-read'."
(let ((coding-system-for-read coding-system)
(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)
(insert-file-contents filename visit beg end replace)))

(defun write-region-as-coding-system (start end filename coding-system
&optional append visit lockname)
"Like `write-region', q.v., but CODING-SYSTEM the fourth arg will be
applied to `coding-system-for-write'."
(let ((coding-system-for-write 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 ((coding-system-for-write (car (reverse args)))
jka-compr-compression-info-list jam-zcat-filename-list)
(write-region start end filename append visit lockname)))

(defun find-file-noselect-as-coding-system (filename coding-system
&optional nowarn rawfile)
"Like `find-file-noselect', q.v., but CODING-SYSTEM the second arg will
be applied to `coding-system-for-read'."
(let ((coding-system-for-read coding-system)
format-alist)
(find-file-noselect filename nowarn rawfile)))
(apply 'write-region start end filename
(nreverse (cdr (nreverse args))))))


;;; @ end
Expand Down
47 changes: 8 additions & 39 deletions poem-e20_2.el
Original file line number Diff line number Diff line change
Expand Up @@ -120,54 +120,23 @@ code."
;; This operation does not change the length.
(set-buffer-multibyte flag))))

(defun find-file-noselect-as-binary (filename &optional nowarn rawfile)
"Like `find-file-noselect', q.v., but don't code and format conversion."
(let ((flag enable-multibyte-characters)
(coding-system-for-read 'binary)
format-alist)
(save-current-buffer
(prog1
(set-buffer (find-file-noselect filename nowarn rawfile))
(set-buffer-multibyte flag)))))

(defun find-file-noselect-as-raw-text (filename &optional nowarn rawfile)
"Like `find-file-noselect', q.v., but it does not code and format conversion
except for line-break code."
(let ((flag enable-multibyte-characters)
(coding-system-for-read 'raw-text)
format-alist)
(save-current-buffer
(prog1
(set-buffer (find-file-noselect filename nowarn rawfile))
(set-buffer-multibyte flag)))))


;;; @ with code-conversion
;;;

(defun insert-file-contents-as-coding-system
(filename coding-system &optional visit beg end replace)
"Like `insert-file-contents', q.v., but CODING-SYSTEM the second arg will
be applied to `coding-system-for-read'."
(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 coding-system)
(coding-system-for-read (car (reverse args)))
format-alist)
(prog1
(insert-file-contents filename visit beg end replace)
(apply 'insert-file-contents filename
(nreverse (cdr (nreverse args))))
(set-buffer-multibyte flag))))

(defun find-file-noselect-as-coding-system (filename coding-system
&optional nowarn rawfile)
"Like `find-file-noselect', q.v., but CODING-SYSTEM the second arg will
be applied to `coding-system-for-read'."
(let ((flag enable-multibyte-characters)
(coding-system-for-read coding-system)
format-alist)
(save-current-buffer
(prog1
(set-buffer (find-file-noselect filename nowarn rawfile))
(set-buffer-multibyte flag)))))


;;; @ end
;;;
Expand Down
38 changes: 14 additions & 24 deletions poem-ltn1.el
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ code conversion will not take place."

(defalias 'insert-file-contents-as-raw-text 'insert-file-contents)

(defun find-file-noselect-as-binary (filename &optional nowarn rawfile)
"Like `find-file-noselect', q.v., but don't code and format conversion."
(let ((emx-binary-mode t))
(find-file-noselect filename nowarn rawfile)))

(defalias find-file-noselect-as-raw-text 'find-file-noselect)

(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))
Expand All @@ -172,24 +165,21 @@ code conversion will not take place."
;;; @ with code-conversion (but actually it might be not done)
;;;

(defun insert-file-contents-as-coding-system
(filename coding-system &optional visit beg end replace)
"Like `insert-file-contents', q.v., but CODING-SYSTEM the second arg will
be applied to `coding-system-for-read'."
(insert-file-contents filename visit beg end replace))

(defun write-region-as-coding-system (start end filename coding-system
&optional append visit lockname)
"Like `write-region', q.v., but CODING-SYSTEM the fourth arg will be
applied to `coding-system-for-write'."
(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)
(write-region start end filename append visit lockname)))

(defun find-file-noselect-as-coding-system (filename coding-system
&optional nowarn rawfile)
"Like `find-file-noselect', q.v., but CODING-SYSTEM the second arg will
be applied to `coding-system-for-read'."
(find-file-noselect filename nowarn rawfile))
(apply 'write-region start end filename
(nreverse (cdr (nreverse args))))))


;;; @ character
Expand Down
50 changes: 18 additions & 32 deletions poem-nemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@
\[emu-nemacs.el]"
(as-binary-input-file
;; Returns list absolute file name and length of data inserted.
(insert-file-contents filename visit)))
(insert-file-contents filename visit beg end replace)))

(defun insert-file-contents-as-raw-text (filename
&optional visit beg end replace)
"Like `insert-file-contents', q.v., but don't character code conversion.
\[emu-nemacs.el]"
(as-binary-input-file
;; Returns list absolute file name and length of data inserted.
(insert-file-contents filename visit)))
(insert-file-contents filename visit beg end replace)))

(defun write-region-as-raw-text-CRLF (start end filename
&optional append visit lockname)
Expand All @@ -222,15 +222,6 @@
(write-region-as-binary (point-min)(point-max)
filename append visit))))

(defun find-file-noselect-as-binary (filename &optional nowarn rawfile)
"Like `find-file-noselect', q.v., but don't code conversion."
(as-binary-input-file (find-file-noselect filename nowarn rawfile)))

(defun find-file-noselect-as-raw-text (filename &optional nowarn rawfile)
"Like `find-file-noselect', q.v., but it does not code conversion
except for line-break code."
(as-binary-input-file (find-file-noselect filename nowarn rawfile)))

(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)))
Expand All @@ -241,29 +232,24 @@ except for line-break code."
;;; @ with code-conversion
;;;

(defun insert-file-contents-as-coding-system
(filename coding-system &optional visit beg end replace)
"Like `insert-file-contents', q.v., but CODING-SYSTEM the second arg will
be applied to `coding-system-for-read'."
(let ((kanji-fileio-code coding-system)
(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)
(insert-file-contents filename visit)))

(defun write-region-as-coding-system (start end filename coding-system
&optional append visit lockname)
"Like `write-region', q.v., but CODING-SYSTEM the fourth arg will be
applied to `coding-system-for-write'."
(let ((kanji-fileio-code 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 ((kanji-fileio-code (car (reverse args)))
jka-compr-compression-info-list jam-zcat-filename-list)
(write-region start end filename append visit)))

(defun find-file-noselect-as-coding-system (filename coding-system
&optional nowarn rawfile)
"Like `find-file-noselect', q.v., but CODING-SYSTEM the second arg will
be applied to `coding-system-for-read'."
(let ((kanji-fileio-code coding-system)
kanji-expected-code)
(find-file-noselect filename nowarn)))
(apply 'write-region start end filename
(nreverse (cdr (nreverse args))))))


;;; @ buffer representation
Expand Down
Loading

0 comments on commit fbbda40

Please sign in to comment.