;;; tex-info.el - Support for editing TeXinfo source.;;;; Maintainer: Per Abrahamsen <auc-tex@sunsite.auc.dk>;; Version: 9.9p;; Copyright (C) 1993, 1994, 1997 Per Abrahamsen ;; ;; This program is free software; you can redistribute it and/or modify;; it under the terms of the GNU General Public License as published by;; the Free Software Foundation; either version 2, or (at your option);; any later version.;; ;; This program is distributed in the hope that it will be useful,;; but WITHOUT ANY WARRANTY; without even the implied warranty of;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the;; GNU General Public License for more details.;; ;; You should have received a copy of the GNU General Public License;; along with this program; if not, write to the Free Software;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.;;; Code:(require'tex)(condition-casenil;Lucid is not providing.(require'texinfo)(error));;; Environments:(defvarTeXinfo-environment-list'(("cartouche")("defcv")("deffn")("defivar")("defmac")("defmethod")("defop")("defopt")("defspec")("deftp")("deftypefn")("deftypefun")("deftypevar")("deftypevr")("defun")("defvar")("defvr")("description")("display")("enumerate")("example")("ifset")("ifclear")("flushleft")("flushright")("format")("ftable")("iftex")("itemize")("lisp")("quotation")("smallexample")("smalllisp")("table")("tex")("titlepage")("vtable"))"Alist of TeXinfo environments.")(defconsttexinfo-environment-regexp;; Overwrite version from `texinfo.el'.(concat"^@\\("(mapconcat'carTeXinfo-environment-list"\\|")"\\|end\\)")"Regexp for environment-like TeXinfo list commands.Subexpression 1 is what goes into the corresponding `@end' statement.")(defunTeXinfo-insert-environment(env)"Insert TeXinfo environment ENV.When called interactively, prompt for an environment."(interactive(list(completing-read"Environment: "TeXinfo-environment-list)))(insert"@"env"\n\n@end "env"\n")(if(null(cdr-safe(assoc"defcv"TeXinfo-environment-list)))(forward-line-2);; apply arguments));;; Keymap:(defvarTeXinfo-mode-mapnil"Keymap for TeXinfo mode.")(ifTeXinfo-mode-map()(setqTeXinfo-mode-map(make-sparse-keymap));; From texinfo.el;; bindings for updating nodes and menus(define-keyTeXinfo-mode-map"\C-c\C-um"'texinfo-master-menu)(define-keyTeXinfo-mode-map"\C-c\C-u\C-m"'texinfo-make-menu)(define-keyTeXinfo-mode-map"\C-c\C-u\C-n"'texinfo-update-node)(define-keyTeXinfo-mode-map"\C-c\C-u\C-e"'texinfo-every-node-update)(define-keyTeXinfo-mode-map"\C-c\C-u\C-a"'texinfo-all-menus-update);; From TeX-mode;; Standard(define-keyTeXinfo-mode-map"\177"'backward-delete-char-untabify)(define-keyTeXinfo-mode-map"\C-c}"'up-list)(define-keyTeXinfo-mode-map"\C-c#"'TeX-normal-mode)(define-keyTeXinfo-mode-map"\C-c\C-n"'TeX-normal-mode)(define-keyTeXinfo-mode-map"\C-c?"'describe-mode);; From tex.el(define-keyTeXinfo-mode-map"\C-c{"'TeX-insert-braces)(define-keyTeXinfo-mode-map"\C-c\C-f"'TeX-font)(define-keyTeXinfo-mode-map"\C-c\C-m"'TeX-insert-macro)(define-keyTeXinfo-mode-map"\e\t"'TeX-complete-symbol)(define-keyTeXinfo-mode-map"\C-c;"'TeX-comment-region)(define-keyTeXinfo-mode-map"\C-c%"'TeX-comment-paragraph)(define-keyTeXinfo-mode-map"\C-c'"'TeX-comment-paragraph);*** Old way(define-keyTeXinfo-mode-map"\C-c:"'TeX-un-comment-region);*** Old way(define-keyTeXinfo-mode-map"\C-c\""'TeX-un-comment);*** Old way;; From tex-buf.el(define-keyTeXinfo-mode-map"\C-c\C-c"'TeX-command-master)(define-keyTeXinfo-mode-map"\C-c\C-k"'TeX-kill-job)(define-keyTeXinfo-mode-map"\C-c\C-l"'TeX-recenter-output-buffer)(define-keyTeXinfo-mode-map"\C-c^"'TeX-home-buffer)(define-keyTeXinfo-mode-map"\C-c`"'TeX-next-error)(define-keyTeXinfo-mode-map"\C-c\C-w"'TeX-toggle-debug-boxes);; From tex.cpl.el;; Simulating LaTeX-mode(define-keyTeXinfo-mode-map"\C-c\C-e"'TeXinfo-insert-environment)(define-keyTeXinfo-mode-map"\C-c\n"'texinfo-insert-@item)(define-keyTeXinfo-mode-map"\C-c\C-s"'texinfo-insert-@node)(define-keyTeXinfo-mode-map"\C-c]"'texinfo-insert-@end))(easy-menu-defineTeXinfo-mode-menuTeXinfo-mode-map"Menu used in TeXinfo mode."(list"TeXinfo"["Environment..."TeXinfo-insert-environmentt]["Node..."texinfo-insert-@nodet]["Macro..."TeX-insert-macrot]["Complete"TeX-complete-symbolt]["Item"texinfo-insert-@itemt](list"Insert Font"["Emphasize"(TeX-fontnil?\C-e):keys"C-c C-f C-e"]["Bold"(TeX-fontnil?\C-b):keys"C-c C-f C-b"]["Typewriter"(TeX-fontnil?\C-t):keys"C-c C-f C-t"]["Small Caps"(TeX-fontnil?\C-c):keys"C-c C-f C-c"]["Italic"(TeX-fontnil?\C-i):keys"C-c C-f C-i"]["Sample"(TeX-fontnil?\C-s):keys"C-c C-f C-s"]["Roman"(TeX-fontnil?\C-r):keys"C-c C-f C-r"])(list"Change Font"["Emphasize"(TeX-fontt?\C-e):keys"C-u C-c C-f C-e"]["Bold"(TeX-fontt?\C-b):keys"C-u C-c C-f C-b"]["Typewriter"(TeX-fontt?\C-t):keys"C-u C-c C-f C-t"]["Small Caps"(TeX-fontt?\C-c):keys"C-u C-c C-f C-c"]["Italic"(TeX-fontt?\C-i):keys"C-u C-c C-f C-i"]["Sample"(TeX-fontt?\C-s):keys"C-u C-c C-f C-s"]["Roman"(TeX-fontt?\C-r):keys"C-u C-c C-f C-r"])"-"["Save Document"TeX-save-documentt]["Next Error"TeX-next-errort](list"TeX Output"["Kill Job"TeX-kill-jobt]["Debug Bad Boxes"TeX-toggle-debug-boxes:styletoggle:selectedTeX-debug-bad-boxes]["Switch to original file"TeX-home-buffert]["Recenter Output Buffer"TeX-recenter-output-buffert])"--"["Create Master Menu"texinfo-master-menut]["Create Menu"texinfo-make-menut]["Update Node"texinfo-update-nodet]["Update Every Node"texinfo-every-node-updatet]["Update All Menus"texinfo-all-menus-updatet]["Uncomment Region"TeX-un-comment-regiont]["Comment Region"TeX-comment-regiont]["Switch to Master file"TeX-home-buffert]["Submit bug report"TeX-submit-bug-reportt]["Reset Buffer"TeX-normal-modet]["Reset AUC TeX"(TeX-normal-modet):keys"C-u C-c C-n"]))(easy-menu-defineTeXinfo-command-menuTeXinfo-mode-map"Menu used in TeXinfo mode for external commands."(append'("Command")(mapcar'TeX-command-menu-entryTeX-command-list)))(defvarTeXinfo-font-list'((?\C-b"@b{""}")(?\C-c"@sc{""}")(?\C-e"@emph{""}")(?\C-i"@i{""}")(?\C-r"@r{""}")(?\C-s"@samp{""}")(?\C-t"@t{""}")(?s"@strong{""}")(?\C-f"@file{""}")(?d"@dfn{""}")(?\C-v"@var{""}")(?k"@key{""}")(?\C-k"@kbd{""}")(?c"@code{""}")(?C"@cite{""}")(?\C-d""""t))"Font commands used in TeXinfo mode. See `TeX-font-list'.");;; Mode:;;; Do not ;;;###autoload because of conflict with standard tex-mode.el.(defuntexinfo-mode()"Major mode for editing files of input for TeXinfo.Special commands:\\{TeXinfo-mode-map}Entering TeXinfo mode calls the value of text-mode-hook,then the value of TeX-mode-hook, and then the value ofTeXinfo-mode-hook."(interactive);; Mostly stolen from texinfo.el(setqmode-name"TeXinfo")(setqmajor-mode'texinfo-mode)(use-local-mapTeXinfo-mode-map)(set-syntax-tabletexinfo-mode-syntax-table)(make-local-variable'page-delimiter)(setqpage-delimiter(concat"^@node [ \t]*[Tt]op\\|^@\\("texinfo-chapter-level-regexp"\\)"))(make-local-variable'require-final-newline)(setqrequire-final-newlinet)(make-local-variable'indent-tabs-mode)(setqindent-tabs-modenil)(make-local-variable'paragraph-separate)(setqparagraph-separate(concat"\b\\|^@[a-zA-Z]*[ \n]\\|"paragraph-separate))(make-local-variable'paragraph-start)(setqparagraph-start(concat"\b\\|^@[a-zA-Z]*[ \n]\\|"paragraph-start))(make-local-variable'fill-column)(setqfill-column72)(make-local-variable'comment-start)(setqcomment-start"@c ")(make-local-variable'comment-start-skip)(setqcomment-start-skip"@c +\\|@comment +")(make-local-variable'words-include-escapes)(setqwords-include-escapest)(if(not(boundp'texinfo-imenu-generic-expression));; This was introduced in 19.30.()(make-local-variable'imenu-generic-expression)(setqimenu-generic-expressiontexinfo-imenu-generic-expression))(make-local-variable'font-lock-defaults)(setqfont-lock-defaults'(texinfo-font-lock-keywordst))(if(not(boundp'texinfo-section-list));; This was included in 19.31.()(make-local-variable'outline-regexp)(setqoutline-regexp(concat"@\\("(mapconcat'cartexinfo-section-list"\\>\\|")"\\>\\)"))(make-local-variable'outline-level)(setqoutline-level'texinfo-outline-level));; Mostly AUC TeX stuff(easy-menu-addTeXinfo-command-menuTeXinfo-mode-map)(easy-menu-addTeXinfo-mode-menuTeXinfo-mode-map)(make-local-variable'TeX-command-current)(setqTeX-command-current'TeX-command-master)(setqTeX-default-extension"texi")(make-local-variable'TeX-esc)(setqTeX-esc"@")(make-local-variable'TeX-auto-regexp-list)(setqTeX-auto-regexp-list'TeX-auto-empty-regexp-list)(make-local-variable'TeX-auto-update)(setqTeX-auto-updatet)(setqTeX-command-default"TeX")(setqTeX-header-end"%*end")(setqTeX-trailer-start(regexp-quote(concatTeX-esc"bye")))(make-local-variable'TeX-complete-list)(setqTeX-complete-list(list(list"@\\([a-zA-Z]*\\)"1'TeX-symbol-listnil)(list""TeX-complete-word)))(make-local-variable'TeX-font-list)(setqTeX-font-listTeXinfo-font-list)(make-local-variable'TeX-font-replace-function)(setqTeX-font-replace-function'TeX-font-replace-macro)(TeX-add-symbols'("appendix""Title")'("appendixsec""Title")'("appendixsection""Title")'("appendixsubsec""Title")'("appendixsubsubsec""Title")'("asis")'("author""Author")'("b""Text")'("bullet")'("bye")'("c""Comment")'("center""Line-of-text")'("chapheading""Title")'("chapter""Title")'("cindex""Entry")'("cite""Reference")'("clear""Flag")'("code""Sample-code")'("comment""Comment")'("contents")'("copyright")'("defcodeindex""Index-name")'("defindex""Index-name")'("dfn""Term")'("dmn""Dimension")'("dots")'("emph""Text")'("equiv")'("error")'("evenfooting"TeXinfo-lrc-argument-hook)'("evenheading"TeXinfo-lrc-argument-hook)'("everyfooting"TeXinfo-lrc-argument-hook)'("everyheading"TeXinfo-lrc-argument-hook)'("exdent""Line-of-text")'("expansion")'("file""Filename")'("finalout")'("findex""Entry")'("footnote""Text-of-footnote")'("footnotestyle""Style")'("group")'("heading""Title")'("headings""On-off-single-double")'("i""Text")'("ignore")'("include""Filename")'("inforef""Node-name""Info-file-name")'("item")'("itemx")'("kbd""Keyboard-characters")'("key""Key-name")'("kindex""Entry")'("majorheading""Title")'("menu")'("minus")'("need""N")'("node""Name""Next""Previous""Up")'("noindent")'("oddfooting"TeXinfo-lrc-argument-hook)'("oddheading"TeXinfo-lrc-argument-hook)'("page")'("paragraphindent""Indent")'("pindex""Entry")'("point")'("print")'("printindex""Index-name")'("pxref""Node-name")'("r""Text")'("ref""Node-name")'("refill")'("result")'("samp""Text")'("sc""Text")'("section""Title")'("set""Flag")'("setchapternewpage""On-off-odd")'("setfilename""Info-file-name")'("settitle""Title")'("shortcontents")'("smallbook")'("sp""N")'("strong""Text")'("subheading""Title")'("subsection""Title")'("subsubheading""Title")'("subsubsection""Title")'("subtitle""Title")'("summarycontents")'("syncodeindex""From-index""Into-index")'("synindex""From-index""Into-index")'("t""Text")'("TeX")'("thischapter")'("thischaptername")'("thisfile")'("thispage")'("tindex""Entry")'("title""Title")'("titlefont""Text")'("titlepage")'("today")'("top""Title")'("unnumbered""Title")'("unnumberedsec""Title")'("unnumberedsubsec""Title")'("unnumberedsubsubsec""Title")'("value""Flag")'("var""Metasyntactic-variable")'("vindex""Entry")'("vskip""Amount")'("w""Text"))(run-hooks'text-mode-hook'TeXinfo-mode-hook))(provide'tex-info);;; tex-info.el ends here