changeset 19606:0fbb8f15450e

(make-coding-system): Make TYPE 5 means raw-text. (after-insert-file-set-buffer-file-coding-system): Set enable-multibyte-characters to nil if we read a file with no-conversion or raw-text-XXXX.
author Kenichi Handa <handa@m17n.org>
date Thu, 28 Aug 1997 10:49:48 +0000
parents 3b700b203cfd
children ea0964347a40
files lisp/international/mule.el
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule.el	Thu Aug 28 10:49:48 1997 +0000
+++ b/lisp/international/mule.el	Thu Aug 28 10:49:48 1997 +0000
@@ -352,7 +352,8 @@
   1: Shift-JIS (or MS-Kanji) used mainly on Japanese PC,
   2: ISO-2022 including many variants,
   3: Big5 used mainly on Chinese PC,
-  4: private, CCL programs provide encoding/decoding algorithm.
+  4: private, CCL programs provide encoding/decoding algorithm,
+  5: Raw-text, which means that text contains random 8-bit codes. 
 MNEMONIC is a character to be displayed on mode line for the coding-system.
 DOC-STRING is a documentation string for the coding-system.
 FLAGS specifies more precise information of each TYPE.
@@ -393,7 +394,7 @@
   ;; At first, set a value of `coding-system' property.
   (let ((coding-spec (make-vector 5 nil))
 	coding-category)
-    (if (or (not (integerp type)) (< type 0) (> type 4))
+    (if (or (not (integerp type)) (< type 0) (> type 5))
 	(error "TYPE argument must be 0..4"))
     (if (or (not (integerp mnemonic)) (<= mnemonic ? ) (> mnemonic 127))
 	(error "MNEMONIC arguemnt must be a printable character."))
@@ -461,7 +462,9 @@
 		    (vectorp (car flags))
 		    (vectorp (cdr flags)))
 	       (aset coding-spec 4 flags)
-	     (error "Invalid FLAGS argument for TYPE 4 (CCL)"))))
+	     (error "Invalid FLAGS argument for TYPE 4 (CCL)")))
+	  (t				; i.e. (= type 5)
+	   (setq coding-category 'coding-category-raw-text)))
     (put coding-system 'coding-system coding-spec)
     (put coding-system 'coding-category coding-category)
     (put coding-category 'coding-systems
@@ -471,7 +474,7 @@
   ;; of subsidiary coding systems, each corresponds to a coding system
   ;; for the detected end-of-line format.
   (put coding-system 'eol-type
-       (if (<= type 3)
+       (if (or (<= type 3) (= type 5))
 	   (make-subsidiary-coding-system coding-system)
 	 0)))
 
@@ -648,6 +651,12 @@
 	    (modified-p (buffer-modified-p)))
 	(if coding-system
 	    (set-buffer-file-coding-system coding-system))
+	(if (or (eq coding-system 'no-conversion)
+		(eq (coding-system-type coding-system) 5))
+	    ;; It seems that random 8-bit codes are read.  We had
+	    ;; better edit this buffer without multibyte character
+	    ;; facility.
+	    (setq enable-multibyte-characters nil))
 	(set-buffer-modified-p modified-p)))
   nil)