comparison lisp/international/mule.el @ 18874:e44ac570f54f

(modify-coding-system-alist): Moved to mule-util.el.
author Geoff Voelker <voelker@cs.washington.edu>
date Sun, 20 Jul 1997 01:31:41 +0000
parents d4c708a5f181
children 7333c3179621
comparison
equal deleted inserted replaced
18873:e05d51998190 18874:e44ac570f54f
628 (vectorp (coding-system-eol-type new-coding))) 628 (vectorp (coding-system-eol-type new-coding)))
629 (setq new-coding 629 (setq new-coding
630 (aref (coding-system-eol-type new-coding) new-eol))) 630 (aref (coding-system-eol-type new-coding) new-eol)))
631 new-coding)))) 631 new-coding))))
632 632
633 (defun modify-coding-system-alist (target-type regexp coding-system)
634 "Modify one of look up tables for finding a coding system on I/O operation.
635 There are three of such tables, file-coding-system-alist,
636 process-coding-system-alist, and network-coding-system-alist.
637
638 TARGET-TYPE specifies which of them to modify.
639 If it is `file', it affects file-coding-system-alist (which see).
640 If it is `process', it affects process-coding-system-alist (which see).
641 If it is `network', it affects network-codign-system-alist (which see).
642
643 REGEXP is a regular expression matching a target of I/O operation.
644 The target is a file name if TARGET-TYPE is `file', a program name if
645 TARGET-TYPE is `process', or a network service name or a port number
646 to connect to if TARGET-TYPE is `network'.
647
648 CODING-SYSTEM is a coding system to perform code conversion on the I/O
649 operation, or a cons of coding systems for decoding and encoding
650 respectively, or a function symbol which returns the cons."
651 (or (memq target-type '(file process network))
652 (error "Invalid target type: %s" target-type))
653 (or (stringp regexp)
654 (and (eq target-type 'network) (integerp regexp))
655 (error "Invalid regular expression: %s" regexp))
656 (if (symbolp coding-system)
657 (if (not (fboundp coding-system))
658 (progn
659 (check-coding-system coding-system)
660 (setq coding-system (cons coding-system coding-system))))
661 (check-coding-system (car coding-system))
662 (check-coding-system (cdr coding-system)))
663 (cond ((eq target-type 'file)
664 (let ((slot (assoc regexp file-coding-system-alist)))
665 (if slot
666 (setcdr slot coding-system)
667 (setq file-coding-system-alist
668 (cons (cons regexp coding-system)
669 file-coding-system-alist)))))
670 ((eq target-type 'process)
671 (let ((slot (assoc regexp process-coding-system-alist)))
672 (if slot
673 (setcdr slot coding-system)
674 (setq process-coding-system-alist
675 (cons (cons regexp coding-system)
676 process-coding-system-alist)))))
677 (t
678 (let ((slot (assoc regexp network-coding-system-alist)))
679 (if slot
680 (setcdr slot coding-system)
681 (setq network-coding-system-alist
682 (cons (cons regexp coding-system)
683 network-coding-system-alist)))))))
684
633 (defun make-unification-table (&rest args) 685 (defun make-unification-table (&rest args)
634 "Make a unification table (char table) from arguments. 686 "Make a unification table (char table) from arguments.
635 Each argument is a list of the form (FROM . TO), 687 Each argument is a list of the form (FROM . TO),
636 where FROM is a character to be unified to TO. 688 where FROM is a character to be unified to TO.
637 689