Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
;;; lang-config.el --- language(Japanese) setup
;; Copyright (C) 1999-2001 YAMASHITA Junji
;; Author: YAMASHITA Junji
;; Keywords: init, lang
;; Version: $Id: lang-config.el,v 1.20 2001/12/06 15:43:43 ysjj Exp $
;; Content-Type: text/plain; charset=iso-2022-jp
;;; Commentary:
;;; Code:
;;; Mule-UCS
(when (or my-emacs20-p my-emacs21-p)
(require 'un-define)
(require 'jisx0213)
(or (coding-system-p 'unicode-escape)
(require 'unicode-escape nil t))
(when (eq window-system 'x)
;; stolen from x0213-font.el(Mule-UCS 0.83)
(let ((query-format "-*-*-%s-r-*-*-16-*-*-*-*-*-*-*")
(fontname-format "-*-*-%s-r-normal-*-16-*-*-*-*-*-jisx0213.2000-%s")
(weight-list '("medium" "bold"))
weight encoding-list encoding fontset)
(while (setq weight (pop weight-list))
(setq encoding-list '("1" "2"))
(while (setq encoding (pop encoding-list))
(when (setq fontset (query-fontset (format query-format weight)))
(set-fontset-font fontset
(intern (concat "japanese-jisx0213-" encoding))
(format fontname-format weight encoding)))))))
(if my-emacs20-p
;; workaround; wrong size passed by `tar-extract' of emacs20.7-
(defadvice unicode-set-auto-coding
(before safe-unicode-set-auto-coding (filename size) activate)
(if (> (+ (point) size) (point-max))
(setq size (- (point-max) (point)))))))
;;;
(set-language-environment "Japanese")
(and (boundp 'default-enable-multibyte-characters)
(setq default-enable-multibyte-characters t))
;; Shorten the encoded-kbd-mode name(" Encoded-kbd") to " Ekb"
(eval-after-load "encoded-kb"
'(setcdr (assq 'encoded-kbd-mode minor-mode-alist) '(" EKb")))
(let ((pref-coding-system
(if (memq system-type '(windows-nt hpux))
'shift_jis
'euc-jp)))
(set-default-coding-systems pref-coding-system)
(unless window-system
(cond ((string= (getenv "TERM") "jfbterm")
(set-terminal-coding-system 'iso-2022-jp-2))
((let ((lang (getenv "LANG")))
(and (>= (length lang) 2)
(string= (substring lang 0 2) "ja")))
(set-terminal-coding-system pref-coding-system))
((eq system-type 'windows-nt)
(set-terminal-coding-system shift_jis))))
(when my-meadow-p
(set-keyboard-coding-system 'shift_jis)
(set-clipboard-coding-system 'shift_jis-dos)
(set-w32-system-coding-system 'shift_jis-dos)))
;;input-method
(if my-meadow-p
(progn
(setq-default mw32-ime-mode-line-state-indicator "[--]")
(setq mw32-ime-mode-line-state-indicator-list '("[--]" "[あ]" "[--]"))
(mw32-ime-initialize)
(setq default-input-method "MW32-IME"))
;; tamago v4
;;(setq egg-startup-file (my-elisp-file "egg-init"))
;; skk
(unless (fboundp 'skk-mode)
(autoload 'skk-mode "skk" nil t)
(autoload 'skk-tutorial "skk-tut" nil t)
(autoload 'skk-isearch-mode-setup "skk-isearch" nil t)
(autoload 'skk-isearch-mode-cleanup "skk-isearch" nil t)
(add-hook 'isearch-mode-hook
#'(lambda ()
(and (boundp 'skk-mode)
skk-mode
(skk-isearch-mode-setup))))
(add-hook 'isearch-mode-end-hook
#'(lambda ()
(and (boundp 'skk-mode)
skk-mode
(skk-isearch-mode-cleanup)
(skk-cursor-set-properly)))))
(setq skk-byte-compile-init-file nil
skk-init-file (my-elisp-file "skk-init"))
(require 'skk-leim)
(unless my-xemacs-p
;; tc2
(setq eelll-configuration-file-name (my-edata-file "eelll.el"))
(setq tcode-init-file-name (my-elisp-file "tc-init"))
(require 'tc-setup nil t))
;; reset `default-input-method' to skk.
(setq-default default-input-method "japanese-skk")
(setq default-input-method "japanese-skk"))
;;;
;;; Fontset/Font
;;;
(when (and (boundp 'standard-translation-table-for-decode)
window-system)
(setq standard-translation-table-for-decode nil)
;; (let ((translation-table (make-translation-table
;; `((?\\ . ,(make-char 'latin-jisx0201 92))
;; (?~ . ,(make-char 'latin-jisx0201 126))))))
;; (mapcar #'(lambda (coding-system)
;; (if (coding-category-sjis-p coding-system)
;; (mapcar #'(lambda (eol-type)
;; (coding-system-put
;; (coding-system-change-eol-conversion
;; coding-system eol-type)
;; 'translation-table-for-decode
;; translation-table))
;; '(nil unix dos mac))))
;; (coding-system-list)))
(defvar jisx0201-display-table (make-display-table)
"*Display table for latin-jisx0201.")
(aset jisx0201-display-table ?\\ (vector (make-char 'latin-jisx0201 92)))
(aset jisx0201-display-table ?~ (vector (make-char 'latin-jisx0201 126)))
(defsubst set-jisx0201-display-slot (slot glyph)
(set-display-table-slot jisx0201-display-table slot glyph))
(defun jisx0201-find-file-hook ()
(and (boundp 'enable-multibyte-characters)
(coding-category-sjis-p buffer-file-coding-system)
(setq buffer-display-table jisx0201-display-table)))
(add-hook 'find-file-hooks 'jisx0201-find-file-hook))
;;; lang-config.el ends here