Mercurial > emacs
comparison lisp/international/mule.el @ 19162:c53a142e847a
Doc fixes.
(default-terminal-coding-system): New var.
(set-terminal-coding-system):
Use default-terminal-coding-system as default.
(default-keyboard-coding-system): New variable.
(set-keyboard-coding-system):
Use default-keyboard-coding-system as default.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 05 Aug 1997 07:05:12 +0000 |
parents | 7333c3179621 |
children | 9d34beb088bf |
comparison
equal
deleted
inserted
replaced
19161:248ec4d8a5e6 | 19162:c53a142e847a |
---|---|
465 (if (<= type 3) | 465 (if (<= type 3) |
466 (make-subsidiary-coding-system coding-system) | 466 (make-subsidiary-coding-system coding-system) |
467 0))) | 467 0))) |
468 | 468 |
469 (defun define-coding-system-alias (alias coding-system) | 469 (defun define-coding-system-alias (alias coding-system) |
470 "Define ALIAS as an alias for coding system | 470 "Define ALIAS as an alias for coding system CODING-SYSTEM." |
471 CODING-SYSTEM." | |
472 (check-coding-system coding-system) | 471 (check-coding-system coding-system) |
473 (let ((parent (coding-system-parent coding-system))) | 472 (let ((parent (coding-system-parent coding-system))) |
474 (if parent | 473 (if parent |
475 (setq coding-system parent))) | 474 (setq coding-system parent))) |
476 (put alias 'coding-system coding-system) | 475 (put alias 'coding-system coding-system) |
489 (cons (aref subsidiaries i) (get (aref eol-variants i) | 488 (cons (aref subsidiaries i) (get (aref eol-variants i) |
490 'alias-coding-systems))) | 489 'alias-coding-systems))) |
491 (setq i (1+ i))))))) | 490 (setq i (1+ i))))))) |
492 | 491 |
493 (defun set-buffer-file-coding-system (coding-system &optional force) | 492 (defun set-buffer-file-coding-system (coding-system &optional force) |
494 "Set buffer-file-coding-system of the current buffer to CODING-SYSTEM. | 493 "Set the file coding-system of the current buffer to CODING-SYSTEM. |
495 If eol-type of the current buffer-file-coding-system is an integer value N, and | 494 This means that when you save the buffer, it will be converted |
496 eol-type of CODING-SYSTEM is a vector, the Nth element of the vector is used | 495 according to CODING-SYSTEM. For a list of possible values of CODING-SYSTEM, |
497 instead of CODING-SYSTEM itself. | 496 use \\[list-coding-systems]. |
498 Optional prefix argument FORCE non-nil means CODING-SYSTEM is set | 497 |
499 regardless of eol-type of the current buffer-file-coding-system." | 498 If the buffer's previous file coding-system value specifies end-of-line |
499 conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is | |
500 merged with the already-specified end-of-line conversion. | |
501 However, if the optional prefix argument FORCE is non-nil, | |
502 them CODING-SYSTEM is used exactly as specified." | |
500 (interactive "zBuffer-file-coding-system: \nP") | 503 (interactive "zBuffer-file-coding-system: \nP") |
501 (check-coding-system coding-system) | 504 (check-coding-system coding-system) |
502 (if (null force) | 505 (if (null force) |
503 (let ((x (coding-system-eol-type buffer-file-coding-system)) | 506 (let ((x (coding-system-eol-type buffer-file-coding-system)) |
504 (y (coding-system-eol-type coding-system))) | 507 (y (coding-system-eol-type coding-system))) |
506 (setq coding-system (aref y x))))) | 509 (setq coding-system (aref y x))))) |
507 (setq buffer-file-coding-system coding-system) | 510 (setq buffer-file-coding-system coding-system) |
508 (set-buffer-modified-p t) | 511 (set-buffer-modified-p t) |
509 (force-mode-line-update)) | 512 (force-mode-line-update)) |
510 | 513 |
514 (defvar default-terminal-coding-system nil | |
515 "Default value for the terminal coding system. | |
516 This is normally set according to the selected language environment. | |
517 See also the command `set-terminal-coding-system'.") | |
518 | |
511 (defun set-terminal-coding-system (coding-system) | 519 (defun set-terminal-coding-system (coding-system) |
512 "Set coding system of your terminal to CODING-SYSTEM. | 520 "Set coding system of your terminal to CODING-SYSTEM. |
513 All outputs to terminal are encoded by the specified coding system." | 521 All text output to the terminal will be encoded |
514 (interactive "zCoding-system for terminal display: ") | 522 with the specified coding system. |
523 For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. | |
524 The default is determined by the selected language environment | |
525 or by the previous use of this command." | |
526 (interactive | |
527 (list (read-coding-system | |
528 (format "Coding system for terminal display (default, %s): " | |
529 (if (and (not (terminal-coding-system)) | |
530 default-terminal-coding-system) | |
531 default-terminal-coding-system))))) | |
532 (if (and (not coding-system) | |
533 (not (terminal-coding-system))) | |
534 (setq coding-system default-terminal-coding-system)) | |
535 (if coding-system | |
536 (setq default-terminal-coding-system coding-system)) | |
515 (set-terminal-coding-system-internal coding-system) | 537 (set-terminal-coding-system-internal coding-system) |
516 (redraw-frame (selected-frame))) | 538 (redraw-frame (selected-frame))) |
517 | 539 |
540 (defvar default-keyboard-coding-system nil | |
541 "Default value of the keyboard coding system. | |
542 This is normally set according to the selected language environment. | |
543 See also the command `set-keyboard-coding-system'.") | |
544 | |
518 (defun set-keyboard-coding-system (coding-system) | 545 (defun set-keyboard-coding-system (coding-system) |
519 "Set coding system of codes sent from terminal keyboard to CODING-SYSTEM. | 546 "Set coding system for keyboard input to CODING-SYSTEM. |
520 In addition, this command toggles Encoded-kbd minor mode. | 547 In addition, this command enables Encoded-kbd minor mode. |
521 If the specified coding system is nil, Encoded-bkd mode is turned off, | 548 \(If CODING-SYSTEM is nil, Encoded-bkd mode is turned off.) |
522 else it is turned on so that user inputs are decoded by the | 549 For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. |
523 specified coding system." | 550 The default is determined by the selected language environment |
524 (interactive "zCoding-system for keyboard input: ") | 551 or by the previous use of this command." |
552 (interactive | |
553 (list (read-coding-system | |
554 (format "Coding system for keyboard input (default, %s): " | |
555 (if (and (not (keyboard-coding-system)) | |
556 default-keyboard-coding-system) | |
557 default-keyboard-coding-system))))) | |
558 (if (and (not coding-system) | |
559 (not (keyboard-coding-system))) | |
560 (setq coding-system default-keyboard-coding-system)) | |
561 (if coding-system | |
562 (setq default-keyboard-coding-system coding-system)) | |
525 (set-keyboard-coding-system-internal coding-system) | 563 (set-keyboard-coding-system-internal coding-system) |
526 (encoded-kbd-mode (if coding-system 1 0))) | 564 (encoded-kbd-mode (if coding-system 1 0))) |
527 | 565 |
528 (defun set-buffer-process-coding-system (decoding encoding) | 566 (defun set-buffer-process-coding-system (decoding encoding) |
529 "Set coding systems to the process associated with the current buffer. | 567 "Set coding systems for the process associated with the current buffer. |
530 DECODING is the coding system to be used to decode input from the process, | 568 DECODING is the coding system to be used to decode input from the process, |
531 ENCODING is to be used to encode output to the process." | 569 ENCODING is the coding system to be used to encode output to the process. |
570 | |
571 For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]." | |
532 (interactive | 572 (interactive |
533 "zCoding-system for process input: \nzCoding-system for process output: ") | 573 "zCoding-system for process input: \nzCoding-system for process output: ") |
534 (let ((proc (get-buffer-process (current-buffer)))) | 574 (let ((proc (get-buffer-process (current-buffer)))) |
535 (if (null proc) | 575 (if (null proc) |
536 (error "no process") | 576 (error "no process") |