Mercurial > emacs
changeset 19267:6e152439176f
(set-default-coding-systems):
Doc-string modified.
(prefer-coding-system): Moved from mule-util.el. Call
set-default-coding-systems.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Sun, 10 Aug 1997 04:07:03 +0000 |
parents | a042f26b7a4c |
children | ecb55608fa91 |
files | lisp/international/mule-cmds.el |
diffstat | 1 files changed, 32 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el Sun Aug 10 04:07:03 1997 +0000 +++ b/lisp/international/mule-cmds.el Sun Aug 10 04:07:03 1997 +0000 @@ -177,13 +177,44 @@ (call-interactively cmd)))) (defun set-default-coding-systems (coding-system) - "Set default value of various coding systems to CODING-SYSTEM." + "Set default value of various coding systems to CODING-SYSTEM. +The follwing coding systems are set: + o coding system of a newly created buffer + o default coding system for terminal output + o default coding system for keyboard input + o default coding system for subprocess I/O" (check-coding-system coding-system) (setq-default buffer-file-coding-system coding-system) (setq default-terminal-coding-system coding-system) (setq default-keyboard-coding-system coding-system) (setq default-process-coding-system (cons coding-system coding-system))) +(defun prefer-coding-system (coding-system) + "Add CODING-SYSTEM at the front of the priority list for automatic detection. +This also sets the following coding systems to CODING-SYSTEM: + o coding system of a newly created buffer + o default coding system for terminal output + o default coding system for keyboard input + o default coding system for subprocess I/O" + (interactive "zPrefer coding system: ") + (if (not (and coding-system (coding-system-p coding-system))) + (error "Invalid coding system `%s'" coding-system)) + (let ((coding-category (coding-system-category coding-system)) + (parent (coding-system-parent coding-system))) + (if (not coding-category) + ;; CODING-SYSTEM is no-conversion or undecided. + (error "Can't prefer the coding system `%s'" coding-system)) + (set coding-category (or parent coding-system)) + (if (not (eq coding-category (car coding-category-list))) + ;; We must change the order. + (setq coding-category-list + (cons coding-category + (delq coding-category coding-category-list)))) + (if (and parent (interactive-p)) + (message "Highest priority is set to %s (parent of %s)" + parent coding-system)) + (set-default-coding-systems (or parent coding-system)))) + ;;; Language support staffs.