aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1997-08-28 10:49:48 +0000
committerKenichi Handa1997-08-28 10:49:48 +0000
commitcd9c317785ccf2e637477ef17872772f284e1651 (patch)
tree54e3aa1d7937cf9b824d52fe87f927454f812940
parent70fd2661f63dc5d8c3067e8cd79ca71d7cd817ad (diff)
downloademacs-cd9c317785ccf2e637477ef17872772f284e1651.tar.gz
emacs-cd9c317785ccf2e637477ef17872772f284e1651.zip
(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.
-rw-r--r--lisp/international/mule.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index b3bb51a6439..30063dd5a9a 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -352,7 +352,8 @@ TYPE is an integer value indicating the type of coding-system as follows:
352 1: Shift-JIS (or MS-Kanji) used mainly on Japanese PC, 352 1: Shift-JIS (or MS-Kanji) used mainly on Japanese PC,
353 2: ISO-2022 including many variants, 353 2: ISO-2022 including many variants,
354 3: Big5 used mainly on Chinese PC, 354 3: Big5 used mainly on Chinese PC,
355 4: private, CCL programs provide encoding/decoding algorithm. 355 4: private, CCL programs provide encoding/decoding algorithm,
356 5: Raw-text, which means that text contains random 8-bit codes.
356MNEMONIC is a character to be displayed on mode line for the coding-system. 357MNEMONIC is a character to be displayed on mode line for the coding-system.
357DOC-STRING is a documentation string for the coding-system. 358DOC-STRING is a documentation string for the coding-system.
358FLAGS specifies more precise information of each TYPE. 359FLAGS specifies more precise information of each TYPE.
@@ -393,7 +394,7 @@ FLAGS specifies more precise information of each TYPE.
393 ;; At first, set a value of `coding-system' property. 394 ;; At first, set a value of `coding-system' property.
394 (let ((coding-spec (make-vector 5 nil)) 395 (let ((coding-spec (make-vector 5 nil))
395 coding-category) 396 coding-category)
396 (if (or (not (integerp type)) (< type 0) (> type 4)) 397 (if (or (not (integerp type)) (< type 0) (> type 5))
397 (error "TYPE argument must be 0..4")) 398 (error "TYPE argument must be 0..4"))
398 (if (or (not (integerp mnemonic)) (<= mnemonic ? ) (> mnemonic 127)) 399 (if (or (not (integerp mnemonic)) (<= mnemonic ? ) (> mnemonic 127))
399 (error "MNEMONIC arguemnt must be a printable character.")) 400 (error "MNEMONIC arguemnt must be a printable character."))
@@ -461,7 +462,9 @@ FLAGS specifies more precise information of each TYPE.
461 (vectorp (car flags)) 462 (vectorp (car flags))
462 (vectorp (cdr flags))) 463 (vectorp (cdr flags)))
463 (aset coding-spec 4 flags) 464 (aset coding-spec 4 flags)
464 (error "Invalid FLAGS argument for TYPE 4 (CCL)")))) 465 (error "Invalid FLAGS argument for TYPE 4 (CCL)")))
466 (t ; i.e. (= type 5)
467 (setq coding-category 'coding-category-raw-text)))
465 (put coding-system 'coding-system coding-spec) 468 (put coding-system 'coding-system coding-spec)
466 (put coding-system 'coding-category coding-category) 469 (put coding-system 'coding-category coding-category)
467 (put coding-category 'coding-systems 470 (put coding-category 'coding-systems
@@ -471,7 +474,7 @@ FLAGS specifies more precise information of each TYPE.
471 ;; of subsidiary coding systems, each corresponds to a coding system 474 ;; of subsidiary coding systems, each corresponds to a coding system
472 ;; for the detected end-of-line format. 475 ;; for the detected end-of-line format.
473 (put coding-system 'eol-type 476 (put coding-system 'eol-type
474 (if (<= type 3) 477 (if (or (<= type 3) (= type 5))
475 (make-subsidiary-coding-system coding-system) 478 (make-subsidiary-coding-system coding-system)
476 0))) 479 0)))
477 480
@@ -648,6 +651,12 @@ function by default."
648 (modified-p (buffer-modified-p))) 651 (modified-p (buffer-modified-p)))
649 (if coding-system 652 (if coding-system
650 (set-buffer-file-coding-system coding-system)) 653 (set-buffer-file-coding-system coding-system))
654 (if (or (eq coding-system 'no-conversion)
655 (eq (coding-system-type coding-system) 5))
656 ;; It seems that random 8-bit codes are read. We had
657 ;; better edit this buffer without multibyte character
658 ;; facility.
659 (setq enable-multibyte-characters nil))
651 (set-buffer-modified-p modified-p))) 660 (set-buffer-modified-p modified-p)))
652 nil) 661 nil)
653 662