comparison lisp/international/mule.el @ 35154:e459e9bee789

(make-coding-system): If the coding system accepts extra latin codes, register such codes as safe for the coding system.
author Kenichi Handa <handa@m17n.org>
date Tue, 09 Jan 2001 02:30:03 +0000
parents 31e8fba26248
children aa8df54873a9
comparison
equal deleted inserted replaced
35153:ac15dde5f6a3 35154:e459e9bee789
714 a value of `safe-charsets' in PLIST." 714 a value of `safe-charsets' in PLIST."
715 ;; Set a value of `coding-system' property. 715 ;; Set a value of `coding-system' property.
716 (let ((coding-spec (make-vector 5 nil)) 716 (let ((coding-spec (make-vector 5 nil))
717 (no-initial-designation t) 717 (no-initial-designation t)
718 (no-alternative-designation t) 718 (no-alternative-designation t)
719 (accept-latin-extra-code nil)
719 coding-category) 720 coding-category)
720 (if (or (not (integerp type)) (< type 0) (> type 5)) 721 (if (or (not (integerp type)) (< type 0) (> type 5))
721 (error "TYPE argument must be 0..5")) 722 (error "TYPE argument must be 0..5"))
722 (if (or (not (integerp mnemonic)) (<= mnemonic ? ) (> mnemonic 127)) 723 (if (or (not (integerp mnemonic)) (<= mnemonic ? ) (> mnemonic 127))
723 (error "MNEMONIC argument must be an ASCII printable character.")) 724 (error "MNEMONIC argument must be an ASCII printable character."))
761 (error "Invalid charset: %s" charset))))) 762 (error "Invalid charset: %s" charset)))))
762 (aset vec i charset)) 763 (aset vec i charset))
763 (setq fl (cdr fl) i (1+ i))) 764 (setq fl (cdr fl) i (1+ i)))
764 (while (and (< i 32) fl) 765 (while (and (< i 32) fl)
765 (aset vec i (car fl)) 766 (aset vec i (car fl))
767 (if (and (= i 16) ; ACCEPT-LATIN-EXTRA-CODE
768 (car fl))
769 (setq accept-latin-extra-code t))
766 (setq fl (cdr fl) i (1+ i))) 770 (setq fl (cdr fl) i (1+ i)))
767 (aset coding-spec 4 vec) 771 (aset coding-spec 4 vec)
768 (setq coding-category 772 (setq coding-category
769 (if (aref vec 8) ; Use locking-shift. 773 (if (aref vec 8) ; Use locking-shift.
770 (or (and (aref vec 7) 'coding-category-iso-7-else) 774 (or (and (aref vec 7) 'coding-category-iso-7-else)
837 (let ((i 160)) 841 (let ((i 160))
838 (while (< i 256) 842 (while (< i 256)
839 (aset safe-chars i t) 843 (aset safe-chars i t)
840 (setq i (1+ i))))) 844 (setq i (1+ i)))))
841 (t 845 (t
842 (aset safe-chars (make-char charset) t))))) 846 (aset safe-chars (make-char charset) t))))
847 (if accept-latin-extra-code
848 (let ((i 128))
849 (while (< i 160)
850 (if (aref latin-extra-code-table i)
851 (aset safe-chars i t))
852 (setq i (1+ i))))))
843 (setq l (cons (cons 'safe-chars safe-chars) l)))) 853 (setq l (cons (cons 'safe-chars safe-chars) l))))
844 (while l 854 (while l
845 (setq prop (car (car l)) val (cdr (car l)) l (cdr l)) 855 (setq prop (car (car l)) val (cdr (car l)) l (cdr l))
846 (if (eq prop 'safe-chars) 856 (if (eq prop 'safe-chars)
847 (progn 857 (progn