yatex

view yatexinf.el @ 183:1c41dc8a28eb

doc fix
author yuuji@gentei.org
date Thu, 13 Oct 2011 10:16:58 +0900
parents
children cf7352dfa40c
line source
1 ;;; -*- Emacs-Lisp -*-
2 ;;; YaTeX interfaces for Texinfo mode.
3 ;;; (c)1994,1998,2001 by HIROSE, Yuuji [yuuji@yatex.org]
4 ;;; Last modified Fri Jun 27 12:10:03 2003 on firestorm
6 (require 'yatex)
7 (or (boundp 'texinfo-mode-map)
8 (load "texinfo"))
10 ;;Put next expressions into your ~/.emacs
11 ;;(defvar texinfo-mode-hook nil)
12 ;;(or (featurep 'yatexinf)
13 ;; (setq texinfo-mode-hook
14 ;; (append (or texinfo-mode-hook '(lambda ()))
15 ;; '((require 'yatexinf) (yatexinfo-setup)))))
17 (defun yatexinfo-define-key (map key binding)
18 "Define keys of yatexinfo with YaTeX-prefix."
19 (if YaTeX-inhibit-prefix-letter
20 (let ((c (aref key 0)))
21 (cond
22 ((and (>= c ?a) (<= c ?z)) (aset key 0 (1+ (- c ?a))))
23 ((and (>= c ?A) (<= c ?Z) (numberp YaTeX-inhibit-prefix-letter))
24 (aset key 0 (1+ (- c ?A))))
25 (t nil))))
26 (define-key map (concat YaTeX-prefix key) binding))
28 (if (featurep 'yatexinf) nil
29 (yatexinfo-define-key texinfo-mode-map "s" 'YaTeX-make-section)
30 (yatexinfo-define-key texinfo-mode-map "S" 'YaTeX-make-section-region)
31 (yatexinfo-define-key texinfo-mode-map "b" 'YaTeX-make-begin-end)
32 (yatexinfo-define-key texinfo-mode-map "B" 'YaTeX-make-begin-end-region)
33 (yatexinfo-define-key texinfo-mode-map "m" 'YaTeX-make-singlecmd)
34 (yatexinfo-define-key texinfo-mode-map "g" 'YaTeX-goto-corresponding-*)
35 (yatexinfo-define-key texinfo-mode-map ">" 'YaTeX-comment-region)
36 (yatexinfo-define-key texinfo-mode-map "<" 'YaTeX-uncomment-region)
37 (yatexinfo-define-key texinfo-mode-map "." 'YaTeX-comment-paragraph)
38 (yatexinfo-define-key texinfo-mode-map "," 'YaTeX-uncomment-region)
39 (yatexinfo-define-key texinfo-mode-map "t" 'YaTeX-typeset-menu)
40 (define-key texinfo-mode-map "\e\C-t" 'lisp-complete-symbol))
42 (defvar yatexinfo-section-table
43 '(("leftline") ("file") ("kbd") ("key") ("code") ("var") ("samp")
44 ("ref") ("xref") ("pxref") ("value") ("footnote")
45 )
46 "Completion table of section-type command of Texinfo.")
48 (defvar yatexinfo-singlecmd-table
49 '(("TeX{}") ("copyright{}") ("setfilename") ("settitle") ("author")
50 ("noindent") ("dots{}") ("bullet") ("cindex")
51 ("chapter") ("section") ("subsection") ("subsubsection")
52 ("unnumbered") ("unnumberedsec") ("unnumberedsubsec")
53 ("unnumberedsubsubsec")
54 ("item") ("itemx"))
55 "Completion table of maketitle-type command of Texinfo.")
57 (defvar yatexinfo-env-table
58 '(("example") ("enumerate") ("iftex") ("titlepage") ("menu") ("table")
59 ("lisp") ("itemize") ("display") ("quotation")
60 ("flushright") ("flushleft") ("center"))
61 "Completion table of begin-type command of Texinfo.")
63 (defvar yatexinfo-struct-begin
64 "@%1%2"
65 "Structure beginning form of Texinfo begin-type commands.")
67 (defvar yatexinfo-struct-end
68 "@end %1"
69 "Structure ending form of Texinfo begin-type commands.")
71 (defvar yatexinfo-struct-name-regexp
72 "table\\|itemize\\|enumerate\\|display\\|example\\|lisp\\|group\\|menu"
73 "All of begin-end type structures")
75 (defvar yatexinfo-ec "@" "Escape character of Texinfo.")
76 (defvar yatexinfo-ec-regexp "@" "Regexp of the escape character of Texinfo.")
77 (defvar yatexinfo-comment-prefix "@c " "Comment prefix of Texinfo.")
79 (defvar yatexinfo-user-completion-table
80 (if YaTeX-dos "~/_inforc" ".yatexinforc")
81 "*Default dictionary of completion table.")
83 (defun yatexinfo-setup ()
84 "Setup all for yatexinfo."
85 (mapcar 'make-local-variable
86 '(env-table section-table singlecmd-table
87 YaTeX-user-completion-table YaTeX-comment-prefix
88 YaTeX-struct-name-regexp
89 YaTeX-struct-begin YaTeX-struct-end YaTeX-ec YaTeX-ec-regexp))
90 (setq env-table yatexinfo-env-table
91 section-table yatexinfo-section-table
92 singlecmd-table yatexinfo-singlecmd-table
93 YaTeX-user-completion-table yatexinfo-user-completion-table
94 YaTeX-comment-prefix yatexinfo-comment-prefix
95 YaTeX-struct-begin yatexinfo-struct-begin
96 YaTeX-struct-end yatexinfo-struct-end
97 YaTeX-struct-name-regexp yatexinfo-struct-name-regexp
98 YaTeX-ec yatexinfo-ec
99 YaTeX-ec-regexp yatexinfo-ec-regexp)
100 (load yatexinfo-user-completion-table t)
101 (run-hooks 'yatex-mode-hook))
103 (provide 'yatexinf)