home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34exe.zip / mutt / contrib / texmode.mut (.txt) < prev    next >
LaTeX Document  |  1995-01-14  |  23KB  |  925 lines

  1. ;; File:
  2. ;;   texmode.mut  -  (La)TeX mode
  3. ;; Description:
  4. ;;   Routines to make (La)TeX input more fun.
  5. ;;   - No attempt has been made to be compatible with GNU emacs or another
  6. ;;     'smart' editor.
  7. ;;   - Based on commands in the "LaTeX User's Guide & Reference Manual" by
  8. ;;     Leslie Lamport.
  9. ;;   - Press 'C-\' for a kind of glossary.
  10. ;;     Example: pressing 'C-\' followed by 'i' inserts '\item '.
  11. ;;   - Press 'M-\' to invoke command completion for LaTeX commands. The
  12. ;;     list of commands contains empty commands, this is visually attractive 
  13. ;;     when the full list is being displayed.
  14. ;;   - All LaTeX commands of the LaTeX manual are known to this program.
  15. ;;     Comment out those commands that you don't need often to speed up
  16. ;;     the search or to make commands unique with less characters.
  17. ;; History:
  18. ;;   940110   M.J. van der Velden
  19. ;;            - fixed documentation errors
  20. ;;            Public Domain (Version 3.1)
  21. ;;   930702   M.J. van der Velden
  22. ;;            - added texEnvironments and changed 'tex-expand-backslash'
  23. ;;              to use it.
  24. ;;            - less info in modeline (the clock is more interesting)
  25. ;;              (LaTeX mode is now a minor mode based on docmode)
  26. ;;            - call command completion for 'M-\' instead of '\'
  27. ;;            - updated to take advantage of the ME30 features
  28. ;;              (mainly completion of lists of string)
  29. ;;            Public Domain (Version 3.0)
  30. ;;   930324   M.J. van der Velden
  31. ;;            - added insert-object now inserts more than one object, this
  32. ;;              results in a smaller mco file.
  33. ;;            Public Domain (Version 2.2)
  34. ;;   930130   M.J. van der Velden
  35. ;;            - tex-popup-cmd now uses query-menu instead of menu-box
  36. ;;            - replaced menu-box by xmenu-box in function tex-error
  37. ;;            - Removed MAIN from tex-mode
  38. ;;            - Changed tex-initialize-commands to MAIN.
  39. ;;            - Commands are added at the end of the texCommands list
  40. ;;              instead of at the front.
  41. ;;                  (insert-object texCommands 1000 ...)
  42. ;;              instead of:
  43. ;;                  (insert-object texCommands -1 ...)
  44. ;;              Now the commands are added in alphabetical order.
  45. ;;            Public Domain (Version 2.1)
  46. ;;   930104   M.J. van der Velden
  47. ;;            - Added command completion for LaTeX commands.
  48. ;;            - This mode is now based on docmode.
  49. ;;            Public Domain (Version 2.0)
  50. ;;   920901   M.J. van der Velden
  51. ;;            Public Domain (Version 1.0)
  52. (include me.mh)
  53. (list
  54.     texCommands      
  55.     texEnvironments
  56. (defun
  57.     ;; Try to guess what the user wants based on the next keystroke.
  58.     tex-expand-backslash
  59.     {
  60.         (string what)
  61.         (int    level)
  62.         (msg "\\")
  63.         (switch (getchar)
  64.             "\\" {
  65.                 (insert-text "\\")
  66.             }
  67.             "\"" {
  68.                 (insert-text "``''")
  69.                 (arg-prefix 2) (previous-character)
  70.             }
  71.             "b" {
  72.                 (ask-user)
  73.                 (what (complete CC_LIST "\\begin What? " texEnvironments))
  74.                 (if (> (current-column) 1) {
  75.                     (insert-text "{\\" what " }")
  76.                     (previous-character)
  77.                 } {
  78.                     (insert-text "\\begin{" what "}^J\\end{" what "}")
  79.                     (previous-line)
  80.                     (end-of-line)
  81.                     (newline)
  82.                 })
  83.             }
  84.             "c" {
  85.                 (msg "\\c")
  86.                 (switch (getchar)
  87.                     "a" {
  88.                         (insert-text "\\caption{}")
  89.                         (previous-character)
  90.                     }
  91.                     "h" {
  92.                         (insert-text "\\chapter{}")
  93.                         (previous-character)
  94.                     }
  95.                     "i" {
  96.                         (insert-text "\\cite{}")
  97.                         (previous-character)
  98.                     }
  99.                 )
  100.             }
  101.             "d" {
  102.                 (insert-text "\\documentstyle{}")
  103.                 (previous-character)
  104.             }
  105.             "e" {
  106.                 (insert-text "{\\em }")
  107.                 (previous-character)
  108.             }
  109.             "f" {
  110.                 (insert-text "\\footnote{}")
  111.                 (previous-character)
  112.             }
  113.             "i" {
  114.                 (insert-text "\\item ")
  115.             }
  116.             "l" {
  117.                 (insert-text "\\label{}")
  118.                 (previous-character)
  119.             }
  120.             "m" {
  121.                 (insert-text "\\maketitle^J")
  122.             }
  123.             "n" {
  124.                 (insert-text "\\newpage^J")
  125.             }
  126.             "p" {
  127.                 (insert-text "\\pagestyle{}")
  128.                 (previous-character)
  129.             }
  130.             "r" {
  131.                 (insert-text "\\ref{}")
  132.                 (previous-character)
  133.             }
  134.             "s" {
  135.                 (ask-user)
  136.                 (msg "\\section Level? ")
  137.                 (level (switch (getchar) "1" 1 "2" 2 "3" 3 default 0))
  138.                 (insert-text "\\")
  139.                 (while (>= (-= level 1) 0) {
  140.                     (insert-text "sub")
  141.                 })
  142.                 (insert-text "section{}^J")
  143.                 (arg-prefix 2) (previous-character)
  144.             }
  145.             "t" {
  146.                 (insert-text "\\tableofcontents^J")
  147.             }
  148.             "v" {
  149.                 (insert-text "\\verb++")
  150.                 (previous-character)
  151.             }
  152.             "$" {
  153.                 (insert-text "$$")
  154.                 (previous-character)
  155.             }
  156.         )
  157.     }
  158. (defun
  159.     MAIN
  160.     {
  161.         (msg "Loading LaTeX commands... ")
  162.         ;;
  163.         ;; Add an empty command after each change in first letter.
  164.         ;; You are encouraged to comment out commands you don't need.
  165.         ;;
  166.             (insert-object texCommands 10000
  167.             "abovedisplayshortskip"
  168.             "abovedisplayskip"
  169.             "acute"
  170.             "addcontentsline"
  171.             "address"
  172.             "addtocontents"
  173.             "addtocounter"
  174.             "addtolength"
  175.             "addvspace"
  176. ;            "ae"
  177. ;            "aleph"
  178. ;            "alph"
  179. ;            "Alph"
  180. ;            "alpha"
  181. ;            "amalg"
  182.             "and"
  183. ;            "angle"
  184.             "appendix"
  185. ;            "approx"
  186.             "arabic"
  187. ;            "arccos"
  188. ;            "arcsin"
  189.             "arg"
  190.             "arraycolsep"
  191.             "arrayrulewidth"
  192.             "arraystretch"
  193. ;            "ast"
  194. ;            "asymp"
  195.             "author"
  196.             ""
  197.         )
  198.         (insert-object texCommands 10000
  199.             "b"
  200.             "backslash"
  201.             "bar"
  202.             "baselineskip"
  203.             "baselinestretch"
  204.             "batchmode"
  205.             "begin{abstract}"
  206.             "begin{array}"
  207.             "begin{description}"
  208.             "begin{displaymath}"
  209.             "begin{document}"
  210.             "begin{enumerate}"
  211.             "begin{equation}"
  212.             "begin{eqnarray}"
  213.             "begin{figure}"
  214.             "begin{itemize}"
  215.             "begin{list}"
  216.             "begin{math}"
  217.             "begin{minipage}"
  218.             "begin{picture}"
  219.             "begin{quote}"
  220.             "begin{sloppypar}"
  221.             "begin{tabbing}"
  222.             "begin{table}"
  223.             "begin{tabular}"
  224.             "begin{thebibliography}"
  225.             "begin{theindex}"
  226.             "begin{titlepage}"
  227.             "begin{trivlist}"
  228.             "begin{verbatim}"
  229.             "begin{verse}"
  230. ;            "beginsection"
  231. ;            "belowdisplayshortskip"
  232. ;            "belowdisplayskip"
  233. ;            "beta"
  234.             "bf"
  235.             "bibitem"
  236.             "bibliography"
  237.             "bibliographystyle"
  238.             "bigcap"
  239. ;            "bigcirc"
  240. ;            "bigcup"
  241. ;            "bigodot"
  242. ;            "bigoplus"
  243. ;            "bigotimes"
  244. ;            "bigskip"
  245. ;            "bigskipamount"
  246. ;            "bigsqcup"
  247. ;            "bigtriangledown"
  248. ;            "bigtriangleup"
  249. ;            "biguplus"
  250. ;            "bigvee"
  251. ;            "bigwedge"
  252. ;            "blackandwhite"
  253. ;            "bmod"
  254.             "boldmath"
  255.             "bot"
  256.             "bottomfraction"
  257. ;            "bowtie"
  258. ;            "Box"
  259. ;            "breve"
  260.             "bullet"
  261.             "bye"
  262.             ""
  263.         )
  264.         (insert-object texCommands 10000
  265.             "c"
  266.             "cal"
  267.             "cap"
  268.             "caption"
  269.             "cc"
  270.             "cdot"
  271.             "cdots"
  272.             "centering"
  273.             "chapter"
  274.             "check"
  275. ;            "chi"
  276.             "circ"
  277.             "circle"
  278.             "cite"
  279.             "cleardoublepage"
  280.             "clearpage"
  281.             "cleartabs"
  282.             "cline"
  283.             "closing"
  284. ;            "clubsuit"
  285.             "colors"
  286.             "colorslides"
  287.             "columnsep"
  288.             "columnseprule"
  289. ;            "cong"
  290. ;            "coprod"
  291.             "copyright"
  292. ;            "cos"
  293. ;            "cosh"
  294. ;            "cot"
  295. ;            "coth"
  296. ;            "csc"
  297. ;            "cup"
  298.             ""
  299.         )
  300.         (insert-object texCommands 10000
  301. ;            "d"
  302. ;            "dag"
  303. ;            "dagger"
  304. ;            "dashv"
  305.             "date"
  306.             "dblfloatpagefraction"
  307.             "dblfloatsep"
  308.             "dbltextfloatsep"
  309.             "dbltopfraction"
  310. ;            "ddag"
  311. ;            "ddagger"
  312. ;            "ddot"
  313. ;            "ddots"
  314. ;            "def"
  315. ;            "deg"
  316. ;            "delta"
  317. ;            "Delta"
  318. ;            "det"
  319. ;            "diamond"
  320. ;            "Diamond"
  321. ;            "diamondsuit"
  322.             "displaystyle"
  323. ;            "div"
  324.             "documentstyle"
  325. ;            "dosupereject"
  326. ;            "dot"
  327. ;            "doteq"
  328. ;            "dotfill"
  329. ;            "doublerulesep"
  330. ;            "downarrow"
  331.             ""
  332.         )
  333.         (insert-object texCommands 10000
  334. ;            "ell"
  335. ;            "em"
  336. ;            "emptyset"
  337. ;            "encl"
  338.             "end{abstract}"
  339.             "end{array}"
  340.             "end{description}"
  341.             "end{displaymath}"
  342.             "end{document}"
  343.             "end{enumerate}"
  344.             "end{equation}"
  345.             "end{eqnarray}"
  346.             "end{figure}"
  347.             "end{itemize}"
  348.             "end{list}"
  349.             "end{math}"
  350.             "end{minipage}"
  351.             "end{picture}"
  352.             "end{quote}"
  353.             "end{sloppypar}"
  354.             "end{tabbing}"
  355.             "end{table}"
  356.             "end{tabular}"
  357.             "end{thebibliography}"
  358.             "end{theindex}"
  359. ;            "endinsert"
  360. ;            "epsilon"
  361. ;            "eqalignno"
  362. ;            "eqalign"
  363. ;            "equiv"
  364. ;            "eta"
  365.             "evensidemargin"
  366. ;            "exists"
  367. ;            "exp"
  368.             "extracolsep"
  369.             ""
  370.         )
  371.         (insert-object texCommands 10000
  372. ;            "fbox"
  373. ;            "fboxrule"
  374. ;            "fboxsep"
  375.             "fill"
  376. ;            "fivebf"
  377. ;            "fivei"
  378. ;            "fiverm"
  379. ;            "fivesy"
  380. ;            "flat"
  381.             "floatpagefraction"
  382.             "floatsep"
  383.             "flushbottom"
  384. ;            "fnsymbol"
  385. ;            "folio"
  386.             "footheight"
  387.             "footline"
  388.             "footnote"
  389.             "footnotemark"
  390.             "footnoterule"
  391.             "footnotesep"
  392.             "footnotesize"
  393.             "footnotetext"
  394.             "footskip"
  395.             "footstrut"
  396. ;            "forall"
  397. ;            "frac"
  398.             "frame"
  399.             "framebox"
  400.             "frenchspacing"
  401. ;            "frown"
  402.              "fussy"
  403.             ""
  404.         )
  405.         (insert-object texCommands 10000
  406. ;            "gamma"
  407. ;            "Gamma"
  408. ;            "gcd"
  409. ;            "geq"
  410. ;            "gg"
  411.             "glossary"
  412.             "glossaryentry"
  413.             "grave"
  414.             ""
  415.         )
  416.         (insert-object texCommands 10000
  417. ;            "H"
  418. ;            "hat"
  419.             "hbar"
  420.             "hbox"
  421.             "headheight"
  422.             "headline"
  423.             "headsep"
  424. ;            "heartsuite"
  425.             "hfill"
  426.             "hline"
  427. ;            "hom"
  428. ;            "hookleftarrow"
  429. ;            "hookrightarrow"
  430.             "hrulefill"
  431.             "hspace"
  432.             "huge"
  433.             "Huge"
  434.             "hyphenation"
  435.             ""
  436.         )
  437.         (insert-object texCommands 10000
  438. ;            "i"
  439. ;            "Im"
  440. ;            "imath"
  441. ;            "in"
  442.             "include"
  443.             "includeonly"
  444.             "indent"
  445.             "index"
  446.             "indexentry"
  447.             "indexspace"
  448. ;            "inf"
  449. ;            "infty"
  450.             "input"
  451. ;            "int"
  452.             "intextsep"
  453.             "invisible"
  454. ;            "iota"
  455. ;            "it"
  456.             "item"
  457.             "itemindent"
  458.             "itemsep"
  459.             ""
  460.         )
  461.         (insert-object texCommands 10000
  462. ;            "j"
  463. ;            "jmath"
  464. ;            "Join"
  465. ;            "jot"
  466.             ""
  467.         )
  468.         (insert-object texCommands 10000
  469. ;            "kappa"
  470. ;            "ker"
  471.             "kill"
  472.             ""
  473.         )
  474.         (insert-object texCommands 10000
  475. ;            "l"
  476.             "label"
  477.             "labelitemi"
  478.             "labelitemii"
  479.             "labelitemiii"
  480.             "labelitemiv"
  481.             "labelitemv"
  482.             "labelsep"
  483.             "labelwidth"
  484. ;            "lambda"
  485. ;            "Lambda"
  486.             "langle"
  487.             "large"
  488.             "Large"
  489.             "LARGE"
  490.             "LaTeX"
  491. ;            "lceil"
  492. ;            "ldots"
  493. ;            "leadsto"
  494. ;            "left"
  495. ;            "leftarrow"
  496. ;            "lefteqn"
  497. ;            "leftharpoondown"
  498. ;            "leftharpoonup"
  499.             "leftmargin"
  500.             "leftmargini"
  501.             "leftmarginii"
  502.             "leftmarginiii"
  503.             "leftmarginiv"
  504.             "leftmarginv"
  505.             "leftmarginvi"
  506. ;            "leftrightarrow"
  507. ;            "leq"
  508. ;            "leqaligno"
  509. ;            "lfloor"
  510. ;            "lg"
  511. ;            "lhd"
  512. ;            "lim"
  513. ;            "liminf"
  514. ;            "limsup"
  515.             "line"
  516.             "linebreak"
  517.             "linethickness"
  518.             "linewidth"
  519.             "listoffigures"
  520.             "listoftables"
  521.             "listparindent"
  522. ;            "ll"
  523. ;            "ln"
  524.             "load"
  525. ;            "log"
  526. ;            "longleftarrow"
  527. ;            "longleftrightarrow"
  528. ;            "longmapsto"
  529. ;            "longrightarrow"
  530.             ""
  531.         )
  532.         (insert-object texCommands 10000
  533.             "magnification"
  534.             "makebox"
  535.             "makefootline"
  536.             "makeglossary"
  537.             "makeheadline"
  538.             "makeindex"
  539.             "makelabel"
  540.             "makelabels"
  541.             "maketitle"
  542. ;            "mapsto"
  543.             "marginpar"
  544.             "marginparpush"
  545.             "marginparsep"
  546.             "marginparwidth"
  547.             "markboth"
  548.             "markright"
  549. ;            "mathindent"
  550. ;            "max"
  551.             "mbox"
  552.             "medskip"
  553.             "medskipamount"
  554. ;            "mho"
  555. ;            "mid"
  556. ;            "midinsert"
  557. ;            "min"
  558. ;            "mit"
  559.             "models"
  560. ;            "mp"
  561. ;            "mu"
  562.             "multicolumn"
  563.             "multiput"
  564.             ""
  565.         )
  566.         (insert-object texCommands 10000
  567. ;            "nabla"
  568.             "natural"
  569. ;            "nearrow"
  570. ;            "neg"
  571. ;            "neq"
  572.             "newcommand"
  573.             "newcounter"
  574.             "newenvironment"
  575.             "newfont"
  576.             "newlength"
  577.             "newline"
  578.             "newpage"
  579.             "newsavebox"
  580.             "newtheorem"
  581. ;            "ni"
  582.             "nocite"
  583.             "nofiles"
  584.             "noindent"
  585.             "nolinebreak"
  586.             "nofrenchspacing"
  587.             "nonumber"
  588.             "nopagebreak"
  589.             "nopagenumbers"
  590.             "normalbottom"
  591.             "normalmarginpar"
  592.             "normalsize"
  593. ;            "not"
  594. ;            "nu"
  595.             "numberline"
  596. ;            "nwarrow"
  597.             ""
  598.         )
  599.         (insert-object texCommands 10000
  600. ;            "0"
  601. ;            "O"
  602.             "oddsidemargin"
  603.             "odot"
  604. ;            "oe"
  605. ;            "OE"
  606. ;            "oint"
  607.             "oldstyle"
  608. ;            "omega"
  609. ;            "Omega"
  610. ;            "ominus"
  611.             "onecolumn"
  612.             "onlynotes"
  613.             "onlyslides"
  614.             "opening"
  615. ;            "oplus"
  616. ;            "oslash"
  617. ;            "otimes"
  618.             "output"
  619. ;            "oval"
  620.             "overbrace"
  621.             "overline"
  622.             ""
  623.         )
  624.         (insert-object texCommands 10000
  625. ;            "P"
  626.             "pagebody"
  627.             "pagebreak"
  628.             "pagecontents"
  629.             "pageinsert"
  630.             "pageno"
  631.             "pagenumbering"
  632.             "pageref"
  633.             "pagestyle"
  634.             "par"
  635.             "paragraph"
  636.             "parallel"
  637.             "parbox"
  638.             "parindent"
  639.             "parsep"
  640.             "parskip"
  641.             "part"
  642.             "partial"
  643.             "partopsep"
  644. ;            "perp"
  645. ;            "Phi"
  646. ;            "Pi"
  647.             "plainoutput"
  648. ;            "pm"
  649. ;            "pmod"
  650.             "poptabs"
  651. ;            "pounds"
  652. ;            "Pr"
  653. ;            "prec"
  654. ;            "preceq"
  655. ;            "prime"
  656. ;            "prod"
  657. ;            "propto"
  658.             "protect"
  659. ;            "ps"
  660. ;            "psi"
  661. ;            "Psi"
  662.             "pushtabs"
  663.             "put"
  664.             ""
  665.         )
  666.         (insert-object texCommands 10000
  667.             "raggedbottom"
  668.             "raggedleft"
  669.             "raggedright"
  670. ;            "raisebox"
  671. ;            "rangle"
  672. ;            "rceil"
  673. ;            "Re"
  674.             "ref"
  675.             "refstepcounter"
  676.             "renewcommand"
  677.             "renewenvironment"
  678.             "reversemarginpar"
  679. ;            "rfloor"
  680. ;            "rhd"
  681. ;            "rho"
  682. ;            "right"
  683. ;            "rightarrow"
  684. ;            "rightharpoondown"
  685. ;            "rightharpoonup"
  686. ;            "rightleftharpoons"
  687.             "rightmargin"
  688.             "rm"
  689.             "roman"
  690.             "Roman"
  691.             "rule"
  692.             ""
  693.         )
  694.         (insert-object texCommands 10000
  695. ;            "S"
  696.             "samepage"
  697.             "savebox"
  698.             "sbox"
  699. ;            "sc"
  700.             "scriptfont"
  701.             "scriptscriptfont"
  702.             "scriptscriptstyle"
  703.             "scriptsize"
  704.             "scriptstyle"
  705. ;            "searrow"
  706.             "sec"
  707.             "section"
  708.             "setcounter"
  709.             "setlength"
  710.             "setminus"
  711.             "settabs"
  712.             "settowidth"
  713. ;            "sevenbf"
  714. ;            "seveni"
  715. ;            "sevensy"
  716. ;            "sf"
  717. ;            "sharp"
  718.             "shortstack"
  719. ;            "sigma"
  720. ;            "Sigma"
  721.             "signature"
  722. ;            "sim"
  723. ;            "simeq"
  724. ;            "sin"
  725. ;            "sinh"
  726. ;            "sl"
  727.             "sloppy"
  728.             "small"
  729.             "smallskip"
  730.             "smallskipamount"
  731. ;            "smile"
  732. ;            "space"
  733. ;            "spadesuit"
  734. ;            "sqcap"
  735. ;            "sqcup"
  736.             "sqrt"
  737. ;            "sqsubset"
  738. ;            "sqsubseteq"
  739. ;            "sqsupset"
  740. ;            "sqsupseteq"
  741. ;            "ss"
  742.             "stackrel"
  743. ;            "star"
  744.             "stepcounter"
  745.             "stop"
  746.             "stretch"
  747.             "subitem"
  748.             "subparagraph"
  749.             "subsection"
  750. ;            "subset"
  751. ;            "subseteq"
  752.             "subsubitem"
  753.             "subsubsection"
  754. ;            "succ"
  755. ;            "succeq"
  756. ;            "sum"
  757. ;            "sup"
  758. ;            "supset"
  759. ;            "supseteq"
  760.             "surd"
  761. ;            "swarrow"
  762.             "symbol"
  763.             ""
  764.         )
  765.         (insert-object texCommands 10000
  766. ;            "t"
  767.             "tabalign"
  768.             "tabbingsep"
  769.             "tabcolsep"
  770.             "tableofcontents"
  771.             "tabsdone"
  772.             "tabset"
  773.             "tabs"
  774. ;            "tan"
  775. ;            "tanh"
  776. ;            "tau"
  777. ;            "teni"
  778.             "TeX"
  779.             "textfloatsep"
  780.             "textfont"
  781.             "textfraction"
  782.             "textheight"
  783.             "textstyle"
  784.             "textwidth"
  785.             "thanks"
  786.             "thepage"
  787. ;            "theta"
  788. ;            "Theta"
  789.             "thicklines"
  790.             "thinlines"
  791.             "thispagestyle"
  792. ;            "tilde"
  793. ;            "times"
  794.             "tiny"
  795.             "title"
  796.             "titlepage"
  797.             "today"
  798.             "top"
  799.             "topfraction"
  800.             "topinsert"
  801.             "topins"
  802.             "topmargin"
  803.             "topsep"
  804.             "topskip"
  805. ;            "triangle"
  806. ;            "triangleleft"
  807. ;            "triangleright"
  808.             "trivlist"
  809.             "tt"
  810.             "twocolumn"
  811.             "typein"
  812.             "typeout"
  813.             ""
  814.         )
  815.         (insert-object texCommands 10000
  816. ;            "u"
  817. ;            "unboldmath"
  818. ;            "underbrace"
  819.             "underline"
  820.             "unitlength"
  821. ;            "unlhd"
  822. ;            "unrhd"
  823.             "uparrow"
  824.             "updownarrow"
  825. ;            "uplus"
  826. ;            "upsilon"
  827. ;            "Upsilon"
  828.             "usebox"
  829.             "usecounter"
  830.             ""
  831.         )
  832.         (insert-object texCommands 10000
  833. ;            "v"
  834.             "value"
  835. ;            "varepsilon"
  836. ;            "varphi"
  837. ;            "varpi"
  838. ;            "varrho"
  839. ;            "varsigma"
  840. ;            "vartheta"
  841. ;            "vbox"
  842. ;            "vdash"
  843. ;            "vdots"
  844. ;            "vec"
  845. ;            "vector"
  846. ;            "vee"
  847.             "verb"
  848.             "verbatim"
  849.             "verse"
  850.             "vfill"
  851. ;            "vfootnote"
  852. ;            "vline"
  853.             "vspace"
  854.             ""
  855.         )
  856.         (insert-object texCommands 10000
  857. ;            "wedge"
  858. ;            "widehat"
  859. ;            "widetilde"
  860. ;            "wp"
  861. ;            "wr"
  862.             ""
  863.         )
  864.         (insert-object texCommands 10000
  865. ;            "xi"
  866. ;            "Xi"
  867.             ""
  868.         )
  869.         (insert-object texCommands 10000
  870. ;            "zeta"
  871.             ""
  872.         )
  873.         (msg "LaTeX commands loaded")
  874.         (msg "Loading LaTeX environments... ")
  875.         (insert-object texEnvironments 10000
  876.             "abstract"
  877.             "array"
  878.             "description"
  879.             "displaymath"
  880.             "document"
  881.             "enumerate"
  882.             "equation"
  883.             "eqnarray"
  884.             "figure"
  885.             "itemize"
  886.             "list"
  887.             "math"
  888.             "minipage"
  889.             "picture"
  890.             "quote"
  891.             "sloppypar"
  892.             "tabbing"
  893.             "table"
  894.             "tabular"
  895.             "thebibliography"
  896.             "theindex"
  897.             "titlepage"
  898.             "trivlist"
  899.             "verbatim"
  900.             "verse"
  901.             ""
  902.         )
  903.         
  904.         (msg "LaTeX environments loaded ")
  905.     }
  906. (defun
  907.     tex-complete-command
  908.     {
  909.         (insert-text (concat "\\" (complete CC_LIST "\\" texCommands)))
  910.     }
  911. (defun
  912.     ;; Initialize LaTeX mode as a minor of docmode.
  913.     doc-mode-hook
  914.     {
  915.         (doc-set-left-flush)
  916.         (doc-minor-mode "LaTeX")
  917.     }
  918.     ;; Enable LaTeX mode.
  919.     tex-mode
  920.     {
  921.         (doc-mode)
  922.         (bind-local-key "tex-expand-backslash" 'C-\')
  923.         (bind-local-key "tex-complete-command" 'M-\')
  924.     }
  925.