Initial git import
[sxemacs] / lisp / mule / mule-tty-init.el
1 ;;; mule-tty-init.el --- Initialization code for console tty under MULE
2
3 ;; Copyright (C) 1998 Free Software Foundation, Inc.
4 ;; Copyright (C) 1998 Kazuyuki IENAGA <kazz@imasy.or.jp>
5
6 ;; Author: Kazuyuki IENAGA <kazz@imasy.or.jp>
7 ;; Keywords: mule, tty, console, dumped
8
9 ;; This file is part of SXEmacs.
10 ;;
11 ;; SXEmacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
15
16 ;; SXEmacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
24 ;;; Commentary:
25
26 ;; This file is dumped with SXEmacs when Mule and TTY support are enabled.
27
28 ;;; Code:
29
30 (defvar mule-tty-win-initted nil)
31
32 (defun init-mule-tty-win ()
33   "Initialize TTY for MULE at startup. Don't call this."
34   (unless mule-tty-win-initted
35     (add-hook
36      'before-init-hook
37      (lambda ()
38        (when (eq (device-type) 'tty)
39          (when (string-match "^kterm" (getenv "TERM"))
40            (set-terminal-coding-system 'euc-jp)
41            (set-keyboard-coding-system 'euc-jp))
42          (set-console-tty-coding-system))))
43     (setq mule-tty-win-initted t)))
44
45 ;;; mule-tty-init.el ends here