+1998-12-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * pccl-om.el (toplevel): Don't require `poem'.
+ Use `code-convert-string' instead of `encode-coding-string' or
+ `decode-coding-string'.
+
+ * poem-om.el (binary): EMACS 20 emulating coding-system for Mule
+ 2.3 based on Emacs 19.[28-34].
+ (raw-text): EMACS 20 emulating coding-system based on native CCL
+ for Mule 2.3 based on Emacs 19.[28-34].
+ (raw-text-dos): Likewise.
+ (find-file-noselect-as-binary): Separate for some Mules.
+
1998-12-15 Tanaka Akira <akr@jaist.ac.jp>
* pccl-20.el: Do not require 'poem.
;;; Code:
-(require 'poem)
-
(eval-when-compile (require 'ccl))
(require 'broken)
(broken-facility ccl-execute-eof-block-on-encoding-null
"Emacs forgets executing CCL_EOF_BLOCK with encoding on empty input."
- (equal (encode-coding-string "" 'test-ccl-eof-block-cs) "[EOF]"))
+ (equal (code-convert-string "" *internal* 'test-ccl-eof-block-cs) "[EOF]"))
(broken-facility ccl-execute-eof-block-on-encoding-some
"Emacs forgets executing CCL_EOF_BLOCK with encoding on non-empty input."
- (equal (encode-coding-string "a" 'test-ccl-eof-block-cs) "a[EOF]"))
+ (equal (code-convert-string "a" *internal* 'test-ccl-eof-block-cs) "a[EOF]"))
(broken-facility ccl-execute-eof-block-on-decoding-null
"Emacs forgets executing CCL_EOF_BLOCK with decoding on empty input."
- (equal (decode-coding-string "" 'test-ccl-eof-block-cs) "[EOF]"))
+ (equal (code-convert-string "" 'test-ccl-eof-block-cs *internal*) "[EOF]"))
(broken-facility ccl-execute-eof-block-on-decoding-some
"Emacs forgets executing CCL_EOF_BLOCK with decoding on non-empty input."
- (equal (decode-coding-string "a" 'test-ccl-eof-block-cs) "a[EOF]"))
+ (equal (code-convert-string "a" 'test-ccl-eof-block-cs *internal*) "a[EOF]"))
(broken-facility ccl-execute-eof-block-on-encoding
"Emacs may forget executing CCL_EOF_BLOCK with encoding."
(defalias 'set-buffer-file-coding-system 'set-file-coding-system)
+(when (and (boundp 'MULE) running-emacs-19)
+ (define-ccl-program ccl-decode-raw-text
+ '(1
+ ((read r1 r0)
+ (loop
+ (r2 = (r1 == ?\x0d))
+ (r2 &= (r0 == ?\x0a))
+ (if r2
+ ((write ?\x0a)
+ (read r1 r0)
+ (repeat))
+ ((write r1)
+ (r1 = (r0 + 0))
+ (read r0)
+ (repeat)
+ ))))
+ (write r1))
+ "Convert line-break code from CRLF to LF.")
+
+ (define-ccl-program ccl-encode-raw-text
+ '(1
+ ((read r0)
+ (loop (write-read-repeat r0))))
+ "Pass through without any conversions.")
+
+ (define-ccl-program ccl-encode-raw-text-CRLF
+ '(2
+ ((loop
+ (read r0)
+ (if (r0 == ?\x0a)
+ (write "\x0d\x0a")
+ (write r0))
+ (repeat))))
+ "Convert line-break code from LF to CRLF.")
+
+ (make-coding-system
+ 'raw-text 4 ?=
+ "No conversion"
+ nil
+ (cons ccl-decode-raw-text ccl-encode-raw-text))
+
+ (make-coding-system
+ 'raw-text-dos 4 ?=
+ "No conversion"
+ nil
+ (cons ccl-decode-raw-text ccl-encode-raw-text-CRLF))
+
+ (make-coding-system
+ 'binary nil ?=
+ "No conversion")
+ )
;;; @ without code-conversion
;;;
(replace-match "\\1\r\n"))
(write-region-as-binary (point-min)(point-max)
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."
+ (as-binary-input-file (find-file-noselect filename nowarn rawfile)))
)
(t
;; for MULE 2.3 based on Emacs 19.28.
(replace-match "\\1\r\n"))
(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 and format conversion."
- (as-binary-input-file (find-file-noselect filename nowarn rawfile)))
+ (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)))
+ ))
(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