comparison lisp/mule/mule-cmds.el @ 5565:48a3d3281b48

Pass eighth bit on TTY consoles to coding system if needed. src/ChangeLog addition: 2011-09-06 Aidan Kehoe <kehoea@parhasard.net> * redisplay-tty.c (init_tty_for_redisplay): Only set the console meta key flag to treat the eight bit as meta if the native coding system doesn't need that. * general-slots.h: * mule-coding.c: * mule-coding.c (syms_of_mule_coding): Move Qiso2022, Qseven to general-slots.h, they're now used in redisplay-tty.c. lisp/ChangeLog addition: 2011-09-06 Aidan Kehoe <kehoea@parhasard.net> * mule/mule-cmds.el (set-language-environment-coding-systems): Set the input mode for TTY consoles to use the eighth bit for character information if the native coding system for the language environment needs that.
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 06 Sep 2011 11:44:50 +0100
parents ac37a5f7e5be
children 3bc58dc9d688
comparison
equal deleted inserted replaced
5564:209024442c24 5565:48a3d3281b48
1383 (maybe-change-coding-system-with-eol default-coding eol-type)))) 1383 (maybe-change-coding-system-with-eol default-coding eol-type))))
1384 ;; (setq default-sendmail-coding-system default-coding) 1384 ;; (setq default-sendmail-coding-system default-coding)
1385 1385
1386 ;; set the native coding system and the default process-output system. 1386 ;; set the native coding system and the default process-output system.
1387 (let ((native (get-native-coding-system-from-language-environment 1387 (let ((native (get-native-coding-system-from-language-environment
1388 language-name (current-locale)))) 1388 language-name (current-locale)))
1389 seven current-input-mode)
1389 1390
1390 (condition-case nil 1391 (condition-case nil
1391 (define-coding-system-alias 'native 1392 (define-coding-system-alias 'native
1392 (maybe-change-coding-system-with-eol native eol-type)) 1393 (maybe-change-coding-system-with-eol native eol-type))
1393 (error 1394 (error
1403 native) 1404 native)
1404 ;; Set the default keyboard and terminal coding systems to the 1405 ;; Set the default keyboard and terminal coding systems to the
1405 ;; native coding system of the language environment. 1406 ;; native coding system of the language environment.
1406 keyboard-coding-system native 1407 keyboard-coding-system native
1407 terminal-coding-system native) 1408 terminal-coding-system native)
1408 1409 ;; Does this coding system use bit 8?
1409 ;; And do the same for any TTYs. 1410 (setq seven (and (eq (coding-system-type native) 'iso2022)
1410 (dolist (con (console-list)) 1411 (coding-system-property native 'seven)))
1411 (when (eq 'tty (device-type (car (console-device-list con)))) 1412 ;; Set the coding system for TTY consoles.
1412 ;; Calling set-input-mode at the same time would be a sane thing 1413 (dolist (console
1413 ;; to do here. I would prefer to default to accepting eight bit 1414 (delete* 'tty (console-list) :key #'console-type :test-not #'eq))
1414 ;; input and not using the top bit for Meta. 1415 (set-console-tty-coding-system console native)
1415 (set-console-tty-coding-system con native))) 1416 (unless seven
1416 1417 ;; The native coding system uses bit 8, so we need to use that bit
1418 ;; for character information, not for meta.
1419 (setq current-input-mode (current-input-mode console))
1420 (and (memq (second current-input-mode) '(nil t))
1421 (set-input-mode nil (first current-input-mode) 'character
1422 (third current-input-mode) console))))
1417 ;; process output should not have EOL conversion. under MS Windows 1423 ;; process output should not have EOL conversion. under MS Windows
1418 ;; and Cygwin, this screws things up (`cmd' is fine with just LF and 1424 ;; and Cygwin, this screws things up (`cmd' is fine with just LF and
1419 ;; `bash' chokes on CR-LF). 1425 ;; `bash' chokes on CR-LF).
1420 (setq default-process-coding-system 1426 (setq default-process-coding-system
1421 (cons (car default-process-coding-system) native))))) 1427 (cons (car default-process-coding-system) native)))))