yatex

diff yatexinf.el @ 141:13a717bee066

$TEXMF/tex/plain/dvips/colordvi.tex
author yuuji@gentei.org
date Thu, 09 Sep 2010 09:11:25 +0900
parents
children cf7352dfa40c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/yatexinf.el	Thu Sep 09 09:11:25 2010 +0900
     1.3 @@ -0,0 +1,103 @@
     1.4 +;;; -*- Emacs-Lisp -*-
     1.5 +;;; YaTeX interfaces for Texinfo mode.
     1.6 +;;; (c)1994,1998,2001 by HIROSE, Yuuji [yuuji@yatex.org]
     1.7 +;;; Last modified Fri Jun 27 12:10:03 2003 on firestorm
     1.8 +
     1.9 +(require 'yatex)
    1.10 +(or (boundp 'texinfo-mode-map)
    1.11 +    (load "texinfo"))
    1.12 +
    1.13 +;;Put next expressions into your ~/.emacs
    1.14 +;;(defvar texinfo-mode-hook nil)
    1.15 +;;(or (featurep 'yatexinf)
    1.16 +;;    (setq texinfo-mode-hook
    1.17 +;;	  (append (or texinfo-mode-hook '(lambda ()))
    1.18 +;;		  '((require 'yatexinf) (yatexinfo-setup)))))
    1.19 +
    1.20 +(defun yatexinfo-define-key (map key binding)
    1.21 +  "Define keys of yatexinfo with YaTeX-prefix."
    1.22 +  (if YaTeX-inhibit-prefix-letter
    1.23 +      (let ((c (aref key 0)))
    1.24 +	(cond
    1.25 +	 ((and (>= c ?a) (<= c ?z)) (aset key 0 (1+ (- c ?a))))
    1.26 +	 ((and (>= c ?A) (<= c ?Z) (numberp YaTeX-inhibit-prefix-letter))
    1.27 +	  (aset key 0 (1+ (- c ?A))))
    1.28 +	 (t nil))))
    1.29 +  (define-key map (concat YaTeX-prefix key) binding))
    1.30 +
    1.31 +(if (featurep 'yatexinf) nil
    1.32 +  (yatexinfo-define-key texinfo-mode-map "s" 'YaTeX-make-section)
    1.33 +  (yatexinfo-define-key texinfo-mode-map "S" 'YaTeX-make-section-region)
    1.34 +  (yatexinfo-define-key texinfo-mode-map "b" 'YaTeX-make-begin-end)
    1.35 +  (yatexinfo-define-key texinfo-mode-map "B" 'YaTeX-make-begin-end-region)
    1.36 +  (yatexinfo-define-key texinfo-mode-map "m" 'YaTeX-make-singlecmd)
    1.37 +  (yatexinfo-define-key texinfo-mode-map "g" 'YaTeX-goto-corresponding-*)
    1.38 +  (yatexinfo-define-key texinfo-mode-map ">" 'YaTeX-comment-region)
    1.39 +  (yatexinfo-define-key texinfo-mode-map "<" 'YaTeX-uncomment-region)
    1.40 +  (yatexinfo-define-key texinfo-mode-map "." 'YaTeX-comment-paragraph)
    1.41 +  (yatexinfo-define-key texinfo-mode-map "," 'YaTeX-uncomment-region)
    1.42 +  (yatexinfo-define-key texinfo-mode-map "t" 'YaTeX-typeset-menu)
    1.43 +  (define-key texinfo-mode-map "\e\C-t" 'lisp-complete-symbol))
    1.44 +
    1.45 +(defvar yatexinfo-section-table
    1.46 +  '(("leftline") ("file") ("kbd") ("key") ("code") ("var") ("samp")
    1.47 +    ("ref") ("xref") ("pxref") ("value") ("footnote")
    1.48 +    )
    1.49 +  "Completion table of section-type command of Texinfo.")
    1.50 +
    1.51 +(defvar yatexinfo-singlecmd-table
    1.52 +  '(("TeX{}") ("copyright{}") ("setfilename") ("settitle") ("author")
    1.53 +    ("noindent") ("dots{}") ("bullet") ("cindex")
    1.54 +    ("chapter") ("section") ("subsection") ("subsubsection")
    1.55 +    ("unnumbered") ("unnumberedsec") ("unnumberedsubsec")
    1.56 +    ("unnumberedsubsubsec")
    1.57 +    ("item") ("itemx"))
    1.58 +  "Completion table of maketitle-type command of Texinfo.")
    1.59 +
    1.60 +(defvar yatexinfo-env-table
    1.61 +  '(("example") ("enumerate") ("iftex") ("titlepage") ("menu") ("table")
    1.62 +    ("lisp") ("itemize") ("display") ("quotation")
    1.63 +    ("flushright") ("flushleft") ("center"))
    1.64 +  "Completion table of begin-type command of Texinfo.")
    1.65 +
    1.66 +(defvar yatexinfo-struct-begin
    1.67 +  "@%1%2"
    1.68 +  "Structure beginning form of Texinfo begin-type commands.")
    1.69 +
    1.70 +(defvar yatexinfo-struct-end
    1.71 +  "@end %1"
    1.72 +  "Structure ending form of Texinfo begin-type commands.")
    1.73 +
    1.74 +(defvar yatexinfo-struct-name-regexp
    1.75 +  "table\\|itemize\\|enumerate\\|display\\|example\\|lisp\\|group\\|menu"
    1.76 +  "All of begin-end type structures")
    1.77 +
    1.78 +(defvar yatexinfo-ec "@" "Escape character of Texinfo.")
    1.79 +(defvar yatexinfo-ec-regexp "@" "Regexp of the escape character of Texinfo.")
    1.80 +(defvar yatexinfo-comment-prefix "@c " "Comment prefix of Texinfo.")
    1.81 +
    1.82 +(defvar yatexinfo-user-completion-table
    1.83 +  (if YaTeX-dos "~/_inforc" ".yatexinforc")
    1.84 +  "*Default dictionary of completion table.")
    1.85 +
    1.86 +(defun yatexinfo-setup ()
    1.87 +  "Setup all for yatexinfo."
    1.88 +  (mapcar 'make-local-variable
    1.89 +	  '(env-table section-table singlecmd-table
    1.90 +	    YaTeX-user-completion-table YaTeX-comment-prefix
    1.91 +	    YaTeX-struct-name-regexp
    1.92 +	    YaTeX-struct-begin YaTeX-struct-end YaTeX-ec YaTeX-ec-regexp))
    1.93 +  (setq env-table		yatexinfo-env-table
    1.94 +	section-table		yatexinfo-section-table
    1.95 +	singlecmd-table		yatexinfo-singlecmd-table
    1.96 +	YaTeX-user-completion-table yatexinfo-user-completion-table
    1.97 +	YaTeX-comment-prefix	yatexinfo-comment-prefix
    1.98 +	YaTeX-struct-begin	yatexinfo-struct-begin
    1.99 +	YaTeX-struct-end	yatexinfo-struct-end
   1.100 +	YaTeX-struct-name-regexp yatexinfo-struct-name-regexp
   1.101 +	YaTeX-ec		yatexinfo-ec
   1.102 +	YaTeX-ec-regexp		yatexinfo-ec-regexp)
   1.103 +  (load yatexinfo-user-completion-table t)
   1.104 +  (run-hooks 'yatex-mode-hook))
   1.105 +
   1.106 +(provide 'yatexinf)