;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  -*- coding: utf-8-unix -*-
;;  FSF Emacs 23 用 Vine Linux YaTeX 設定
;;    Munehiro Yamamoto <munepi@vinelinux.org>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; YaTeX
;;   [La]TeX 入力モード
;;   M-x yatex とするか、.tex で終わるファイルを読み込むと起動します
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)

;; [推奨] \C-c から \C-c \C- へ変更 [yatex:04567]
(unless (boundp 'YaTeX-inhibit-prefix-letter)
    (setq YaTeX-inhibit-prefix-letter t))

;; YaTeX-mode
;; yatex-mode を起動させる設定
(setq auto-mode-alist 
      (append 
       '(("\\.\\(tex\\|sty\\|cls\\|fd\\|ind\\|idx\\|ltx\\|clo\\|bbl\\)$" . 
	  yatex-mode)) auto-mode-alist))
(setq 
 ;; YaTeX-kanji-code 4               ;; 1: SJIS, 2: JIS, 3: EUC, 4: UTF-8
 ;; YaTeX-latex-message-code 'utf-8  ;; 文字化けしないようにする
 ;; YaTeX-no-begend-shortcut t    ;; shortcut ではなく補完を利用
 YaTeX-use-AMS-LaTeX t
 YaTeX-use-LaTeX2e t
 YaTeX-use-font-lock t
 ;; dvi2-command "pxdvi"  ;; xdvi
 ;; tex-command "platex -kanji=utf8 -src-specials"
 ;; dviprint-command-format "dvips %s | lpr"
 ;; makeindex-command "mendex -U"
 ;; bibtex-command "pbibtex -kanji=utf8"
 )

;;; TeX-master に関しては safe にする
;;; from AUCTeX tex.el 
(put 'TeX-master 'safe-local-variable
     (lambda (x)
       (or (stringp x)
	   (member x (quote (t nil shared dwim))))))

;;; emacsclient サーバを起動
(add-hook 'yatex-mode-hook 
	  '(lambda () (server-start)))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(provide 'vine-default-yatex)

;; Local Variables:
;; mode: emacs-lisp
;; End:
