Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* poem-20.el (write-region-as-binary): Bind `jam-zcat-filename-list' …

…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...
commit fbbda4052d32c9c942e85ff2ca980af2b4ff578e 1 parent a443e90
yamaoka authored
View
31 ChangeLog
@@ -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
View
9 poe-18.el
@@ -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.
View
50 poem-20.el
@@ -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)
@@ -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
View
47 poem-e20_2.el
@@ -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
;;;
View
38 poem-ltn1.el
@@ -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))
@@ -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
View
50 poem-nemacs.el
@@ -200,7 +200,7 @@
\[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)
@@ -208,7 +208,7 @@
\[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)
@@ -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)))
@@ -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
View
76 poem-om.el
@@ -224,23 +224,6 @@ find-file-hooks, etc.
filename append visit))))
))
-(defun find-file-noselect-as-binary (filename &optional nowarn rawfile)
- "Like `find-file-noselect', q.v., but don't code and format 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 and format conversion
-except for line-break code."
- (save-current-buffer
- (prog1
- (set-buffer (find-file-noselect-as-binary filename nowarn rawfile))
- (let ((flag (buffer-modified-p)))
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward "\r$" nil t)
- (replace-match "")))
- (set-buffer-modified-p flag)))))
-
(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)))
@@ -251,45 +234,40 @@ 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 ((file-coding-system-for-read coding-system))
- (insert-file-contents filename visit beg end replace)))
+(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-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 (jka-compr-compression-info-list jam-zcat-filename-list)
- (write-region start end filename append visit lockname coding-system)))
-
- (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 ((file-coding-system-for-read coding-system))
- (find-file-noselect filename nowarn rawfile)))
+ (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-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 (jka-compr-compression-info-list jam-zcat-filename-list)
- (write-region start end filename append visit coding-system)))
-
- (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 ((file-coding-system-for-read coding-system))
- (find-file-noselect filename nowarn)))
+ (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)))
))
Please sign in to comment.
Something went wrong with that request. Please try again.