initial version of bigclean-emacs,from svn to git
[bigclean-emacs.git] / emacs / .emacs.d / site-lisp / maxima-font-lock.el
blobcd36cc62945ed12581fe4daf4e567050c1cf7a9f
1 ;;; maxima-font-lock.el --- syntax highlighting for maxima.el
3 ;; Copyright: (C) 2001 Jay Belanger
5 ;; Author: Jay Belanger <belanger@truman.edu>
6 ;; $Name: version-5_19_2 $
7 ;; $Revision: 1.16 $
8 ;; $Date: 2009/01/08 04:47:51 $
9 ;; Keywords: maxima, font-lock
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
16 ;; This program is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;; General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
26 ;; Please send suggestions and bug reports to <belanger@truman.edu>
27 ;; The latest version of this package should be available at
28 ;; ftp://vh213601.truman.edu/pub/Maxima
30 ;;; Commentary
32 ;;; This file is used for font-lock for maxima.el
34 ;; The keywords are divided into the following groups, following the
35 ;; Maxima info files:
36 ;; Functions (font-lock-builtin-face or font-lock-keyword-face)
37 ;; Variables (font-lock-keyword-face)
38 ;; Constants (font-lock-constant-face)
39 ;; Keywords (font-lock-keyword-face)
40 ;; Declarations (font-lock-keyword-face)
41 ;; Operators (font-lock-keyword-face)
42 ;; Property (font-lock-keyword-face)
43 ;; Macros (font-lock-keyword-face)
44 ;; Special operators (font-lock-keyword-face)
45 ;; Special symbols (font-lock-keyword-face)
48 ;;; Code
50 (require 'font-lock)
51 (provide 'maxima-font-lock)
54 ;;; The faces
55 ;; (defvar maxima-variable-face 'maxima-variable-face
56 ;; "The face to use for the variables.")
58 ;; (defvar maxima-function-face 'maxima-function-face
59 ;; "The face to use for the functions.")
61 ;; (defvar maxima-constant-face 'maxima-constant-face
62 ;; "The face to use for the constants.")
64 ;; (defvar maxima-keyword-face 'maxima-keyword-face
65 ;; "The face to use for the keywords.")
67 ;; (defvar maxima-operator-face 'maxima-operator-face
68 ;; "The face to use for the operators.")
70 ;; (defvar maxima-property-face 'maxima-property-face
71 ;; "The face to use for the properties.")
73 ;; (defvar maxima-macro-face 'maxima-macro-face
74 ;; "The face to use for the macros.")
76 ;; (defvar maxima-specop-face 'maxima-specop-face
77 ;; "The face to use for the special operators.")
79 ;; (defvar maxima-declaration-face 'maxima-declaration-face
80 ;; "The face to use for the macros.")
82 ;; (defvar maxima-specsymb-face 'maxima-specsymb-face
83 ;; "The face to use for the special symbols.")
85 ;;; the regexps
86 (defvar maxima-vars-1
87 (list
88 "%"
89 "%%"
90 "%edispflag"
91 "%rnum_list"))
94 (defvar maxima-match-variables-1
95 (concat "\\<\\("
96 (eval-when-compile (regexp-opt maxima-vars-1))
97 "\\)\\>")
98 "regexp to match the maxima variables.")
100 (defvar maxima-vars-2
101 (list
102 "all_dotsimp_denoms"
103 "assume_pos"
104 "assume_pos_pred"
105 "change_filedefaults"
106 "current_let_rule_package"
107 "default_let_rule_package"
108 "display_format_internal"
109 "error_size"
110 "error_syms"
111 "expandwrt_denom"
112 "file_search"
113 "file_string_print"
114 "in_netmath"
115 "integration_constant_counter"
116 "isolate_wrt_times"
117 "let_rule_packages"
118 "linsolve_params"
119 "matrix_element_add"
120 "matrix_element_mult"
121 "matrix_element_transpose"
122 "mode_checkp"
123 "mode_check_errorp"
124 "mode_check_warnp"
125 "plot_options"
126 "solve_inconsistent_error"
127 "sublis_apply_lambda"
128 "taylor_logexpand"
129 "taylor_order_coefficients"
130 "taylor_truncate_polynomials"
131 "timer_devalue"
132 "tr_array_as_ref"
133 "tr_bound_function_applyp"
134 "tr_file_tty_messagesp"
135 "tr_float_can_branch_complex"
136 "tr_function_call_default"
137 "tr_gen_tags"
138 "tr_numer"
139 "tr_optimize_max_loop"
140 "tr_output_file_default"
141 "tr_predicate_brain_damage"
142 "tr_semicompile"
143 "tr_state_vars"
144 "tr_true_name_of_file_being_translated"
145 "tr_version"
146 "tr_warn_bad_function_calls"
147 "tr_warn_fexpr"
148 "tr_warn_meval"
149 "tr_warn_mode"
150 "tr_warn_undeclared"
151 "tr_warn_undefined_variable"
152 "tr_windy"
153 "use_fast_arrays"))
156 (defvar maxima-match-variables-2
157 (concat "\\<\\("
158 (eval-when-compile (regexp-opt maxima-vars-2))
159 "\\)\\>")
160 "regexp to match the maxima variables.")
162 (defvar maxima-vars-3
163 (list
164 "absboxchar"
165 "activecontexts"
166 "algebraic"
167 "algepsilon"
168 "algexact"
169 "aliases"
170 "all"
171 "allsym"
172 "arrays"
173 "askexp"
174 "assumescalar"
175 "backsubst"
176 "backtrace"
177 "batchkill"
178 "batcount"
179 "berlefact"
180 "bftorat"
181 "bftrunc"
182 "bothcases"
183 "boxchar"
184 "breakup"
185 "cauchysum"
186 "cflength"
187 "compgrind"
188 "context"
189 "contexts"
190 "counter"
191 "cursordisp"
192 "debugmode"
193 "demoivre"
194 "dependencies"
195 "derivabbrev"
196 "derivsubst"
197 "detout"
198 "diagmetric"
199 "dim"
200 "direc"
201 "dispflag"
202 "display2d"
203 "doallmxops"
204 "domain"
205 "domxexpt"
206 "domxmxops"
207 "domxnctimes"
208 "dontfactor"
209 "doscmxops"
210 "doscmxplus"
211 "dot0nscsimp"
212 "dot0simp"
213 "dot1simp"
214 "dotassoc"
215 "dotconstrules"
216 "dotdistrib"
217 "dotexptsimp"
218 "dotident"
219 "dotscrules"
220 "dskall"
221 "erfflag"
222 "errexp"
223 "errintsce"
224 "errorfun"
225 "evflag"
226 "evfun"
227 "exptdispflag"
228 "expon"
229 "exponentialize"
230 "expop"
231 "exptisolate"
232 "exptsubst"
233 "facexpand"
234 "factlim"
235 "factorflag"
236 "filename"
237 "filenum"
238 "float2bf"
239 "fortindent"
240 "fortspaces"
241 "fpprec"
242 "fpprintprec"
243 "functions"
244 "gammalim"
245 "genindex"
246 "gensumnum"
247 "globalsolve"
248 "gradefs"
249 "halfangles"
250 "ibase"
251 "icounter"
252 "idummyx"
253 "ieqnprint"
254 "inchar"
255 "inflag"
256 "intfaclim"
257 "infolists"
258 "intpolabs"
259 "intpolerror"
260 "intpolrel"
261 "keepfloat"
262 "lasttime"
263 "letrat"
264 "lhospitallim"
265 "linechar"
266 "linedisp"
267 "linel"
268 "linenum"
269 "linsolvewarn"
270 "listarith"
271 "listconstvars"
272 "listdummyvars"
273 "lmxchar"
274 "loadprint"
275 "logabs"
276 "logarc"
277 "logconcoeffp"
278 "logexpand"
279 "lognegint"
280 "lognumer"
281 "logsimp"))
283 (defvar maxima-match-variables-3
284 (concat "\\<\\("
285 (eval-when-compile (regexp-opt maxima-vars-3))
286 "\\)\\>")
287 "regexp to match the maxima variables.")
289 (defvar maxima-vars-4
290 (list
291 "m1pbranch"
292 "macroexpansion"
293 "maperror"
294 "maxapplydepth"
295 "maxapplyheight"
296 "maxnegex"
297 "maxposex"
298 "maxprime"
299 "maxtayorder"
300 "modulus"
301 "multiplicities"
302 "myoptions"
303 "negdistrib"
304 "negsumdispflag"
305 "newfac"
306 "niceindicespref"
307 "nolabels"
308 "noundisp"
309 "obase"
310 "omega"
311 "opproperties"
312 "opsubst"
313 "optimprefix"
314 "optionset"
315 "packagefile"
316 "parsewindow"
317 "partswitch"
318 "pfeformat"
319 "piece"
320 "poislim"
321 "powerdisp"
322 "prederror"
323 "prodhack"
324 "programmode"
325 "prompt"
326 "psexpand"
327 "radexpand"
328 "radprodexpand"
329 "ratalgdenom"
330 "ratdenomdivide"
331 "ratepsilon"
332 "rateinstein"
333 "ratfac"
334 "ratmx"
335 "ratprint"
336 "ratrieman"
337 "ratriemann"
338 "ratsimpexpons"
339 "ratweights"
340 "ratweyl"
341 "ratwtlvl"
342 "realonly"
343 "refcheck"
344 "rmxchar"
345 "rombergabs"
346 "rombergit"
347 "rombergmin"
348 "rombergtol"
349 "rootsconmode"
350 "rootsepsilon"
351 "savedef"
352 "savefactors"
353 "scalarmatrixp"
354 "setcheck"
355 "setcheckbreak"
356 "setval"
357 "showtime"
358 "simpsum"
359 "solvedecomposes"
360 "solveexplicit"
361 "solvefactors"
362 "solvenullwarn"
363 "solveradcan"
364 "solvetrigwarn"
365 "sparse"
366 "sqrtdispflag"
367 "stardisp"
368 "sumexpand"
369 "sumhack"
370 "sumsplitfact"
371 "taylordepth"
372 "tlimswitch"
373 "transbind"
374 "transcompile"
375 "transrun"
376 "trigexpandplus"
377 "trigexpandtimes"
378 "triginverses"
379 "trigsign"
380 "ttyintfun"
381 "ttyintnum"
382 "ttyoff"
383 "undeclaredwarn"
384 "values"
385 "vect_cross"
386 "verbose"
387 "zerobern"
388 "zeta%pi"
389 "zunderflow"))
392 (defvar maxima-match-variables-4
393 (concat "\\<\\("
394 (eval-when-compile (regexp-opt maxima-vars-4))
395 "\\)\\>")
396 "regexp to match the maxima variables.")
398 (defvar maxima-fns-1
399 (list
401 "%th"
402 "%j"
403 "%k"
404 "?round"
405 "?truncate"))
408 (defvar maxima-match-functions-1
409 (concat "\\<\\("
410 (eval-when-compile (regexp-opt maxima-fns-1))
411 "\\)\\>" )
412 "regexp to match the maxima functions.")
414 (defvar maxima-fns-2
415 (list
416 "acos"
417 "acosh"
418 "acot"
419 "acoth"
420 "acsc"
421 "acsch"
422 "activate"
423 "addcol"
424 "addrow"
425 "adjoint"
426 "airy"
427 "alarmclock"
428 "algsys"
429 "alias"
430 "alloc"
431 "allroots"
432 "anti"
433 "antid"
434 "antidiff"
435 "append"
436 "appendfile"
437 "apply"
438 "apply1"
439 "apply2"
440 "applyb1"
441 "apply_nouns"
442 "apropos"
443 "args"
444 "array"
445 "arrayapply"
446 "arrayinfo"
447 "arraymake"
448 "asec"
449 "asech"
450 "asin"
451 "asinh"
452 "askinteger"
453 "asksign"
454 "assume"
455 "asymp"
456 "asympa"
457 "at"
458 "atan"
459 "atan2"
460 "atanh"
461 "atom"
462 "atrig1"
463 "atvalue"
464 "augcoefmatrix"
465 "backup"
466 "bashindices"
467 "batch"
468 "batchload"
469 "batcon"
470 "bern"
471 "bernpoly"
472 "bessel"
473 "beta"
474 "bezout"
475 "bffac"
476 "bfloat"
477 "bfloatp"
478 "bfpsi"
479 "bfzeta"
480 "bgzeta"
481 "bhzeta"
482 "bindtest"
483 "binomial"
484 "block"
485 "bothcoef"
486 "box"
487 "break"
488 "bug"
489 "burn"
490 "bzeta"
491 "cabs"
492 "canform"
493 "canten"
494 "carg"
495 "cartan"
496 "catch"
497 "cbfac"
498 "cf"
499 "cfdisrep"
500 "cfexpand"
501 "cgamma"
502 "cgamma2"
503 "changevar"
504 "charpoly"
505 "check_overlaps"
506 "chr1"
507 "chr2"
508 "christof"
509 "closefile"
510 "closeps"
511 "coeff"
512 "coefmatrix"
513 "col"
514 "collapse"
515 "columnvector"
516 "combine"
517 "comp2pui"
518 "compfile"
519 "compile"
520 "compile_file"
521 "compile_lisp_file"
522 "concat"
523 "conjugate"
524 "cons"
525 "constantp"
526 "cont2part"
527 "content"
528 "continue"
529 "contract"
530 "copylist"
531 "copymatrix"
532 "cos"
533 "cosh"
534 "cot"
535 "coth"
536 "covdiff"
537 "create_list"
538 "csc"
539 "csch"
540 "curvature"
541 "cyc"
542 "dblint"
543 "ddt"
544 "deactivate"
545 "debug"
546 "debugprintmode"
547 "declare"
548 "declare_translated"
549 "declare_weight"
550 "decsym"
551 "defcon"
552 "define"
553 "define_variable"
554 "defint"
555 "defmatch"
556 "defrule"
557 "deftaylor"
558 "delete"
559 "delfile"
560 "delta"
561 "demo"
562 "denom"
563 "depends"
564 "derivdegree"
565 "derivlist"
566 "describe"
567 "desolve"
568 "determinant"
569 "diagmatrix"
570 "diff"
571 "dimension"
572 "direct"
573 "diskfree"
574 "disolate"
575 "disp"
576 "dispcon"
577 "dispform"
578 "dispfun"
579 "display"
580 "disprule"
581 "dispterms"
582 "distrib"
583 "divide"
584 "divsum"
585 "dlt"
586 "dotsimp"
587 "dpart"
588 "dscalar"))
590 (defvar maxima-match-functions-2
591 (concat "\\<\\("
592 (eval-when-compile (regexp-opt maxima-fns-2))
593 "\\)\\>")
594 "regexp to match the maxima functions.")
596 (defvar maxima-fns-3
597 (list
598 "echelon"
599 "eigenvalues"
600 "eigenvectors"
601 "einstein"
602 "ele2comp"
603 "ele2polynome"
604 "ele2pui"
605 "elem"
606 "eliminate"
607 "ematrix"
608 "endcons"
609 "entermatrix"
610 "entier"
611 "equal"
612 "erf"
613 "errcatch"
614 "error"
615 "errormsg"
616 "euler"
617 "ev"
618 "eval"
619 "evenp"
620 "example"
621 "exp"
622 "expand"
623 "expandwrt"
624 "expandwrt_factored"
625 "explose"
626 "express"
627 "expt"
628 "extract_linear_equations"
629 "ezgcd"
630 "factcomb"
631 "factor"
632 "factorial"
633 "factorout"
634 "factorsum"
635 "facts"
636 "fassave"
637 "fasttimes"
638 "fast_central_elements"
639 "fast_linsolve"
640 "featurep"
641 "fft"
642 "fib"
643 "fibtophi"
644 "filedefaults"
645 "filename_merge"
646 "file_type"
647 "fillarray"
648 "first"
649 "fix"
650 "float"
651 "floatdefunk"
652 "floatnump"
653 "flush"
654 "flushd"
655 "flushnd"
656 "forget"
657 "fortmx"
658 "fortran"
659 "freeof"
660 "fullmap"
661 "fullmapl"
662 "fullratsimp"
663 "fullratsubst"
664 "funcsolve"
665 "fundef"
666 "funmake"))
669 (defvar maxima-match-functions-3
670 (concat "\\<\\("
671 (eval-when-compile (regexp-opt maxima-fns-3))
672 "\\)\\>")
673 "regexp to match the maxima functions.")
675 (defvar maxima-fns-4
676 (list
677 "gamma"
678 "gauss"
679 "gcd"
680 "gcfactor"
681 "gendiff"
682 "genfact"
683 "genmatrix"
684 "get"
685 "getchar"
686 "gfactor"
687 "gfactorsum"
688 "go"
689 "gradef"
690 "gramschmidt"
691 "grind"
692 "grobner_basis"
693 "hach"
694 "hipow"
695 "horner"
696 "ic1"
697 "ident"
698 "idummy"
699 "ieqn"
700 "ift"
701 "ilt"
702 "imagpart"
703 "imetric"
704 "indices"
705 "infix"
706 "innerproduct"
707 "inpart"
708 "inrt"
709 "integerp"
710 "integrate"
711 "interpolate"
712 "intopois"
713 "intosum"
714 "intsce"
715 "invert"
716 "is"
717 "ishow"
718 "isolate"
719 "isqrt"
720 "jacobi"
721 "kdelta"
722 "kill"
723 "killcontext"
724 "kostka"
725 "labels"
726 "lambda"
727 "laplace"
728 "last"
729 "lc"
730 "lc2kdt"
731 "lcm"
732 "ldefint"
733 "ldisp"
734 "ldisplay"
735 "length"
736 "let"
737 "letrules"
738 "letsimp"
739 "levi_civita"
740 "lgtreillis"
741 "lhs"
742 "limit"
743 "linsolve"
744 "lispdebugmode"
745 "listarray"
746 "listofvars"
747 "listp"
748 "list_nc_monomials"
749 "load"
750 "loadfile"
751 "local"
752 "log"
753 "logcontract"
754 "lopow"
755 "lorentz"
756 "lpart"
757 "lratsubst"
758 "lriccicom"
759 "ltreillis"))
762 (defvar maxima-match-functions-4
763 (concat "\\<\\("
764 (eval-when-compile (regexp-opt maxima-fns-4))
765 "\\)\\>")
766 "regexp to match the maxima functions.")
768 (defvar maxima-fns-5
769 (list
770 "makebox"
771 "makefact"
772 "makegamma"
773 "makelist"
774 "make_array"
775 "map"
776 "mapatom"
777 "maplist"
778 "matchdeclare"
779 "matchfix"
780 "matrix"
781 "matrixmap"
782 "matrixp"
783 "mattrace"
784 "max"
785 "member"
786 "metric"
787 "min"
788 "minfactorial"
789 "minor"
790 "mod"
791 "mode_declare"
792 "mode_identity"
793 "mon2schur"
794 "mono"
795 "monomial_dimensions"
796 "motion"
797 "multinomial"
798 "multi_elem"
799 "multi_orbit"
800 "multi_pui"
801 "multsym"
802 "multthru"
803 "ncexpt"
804 "ncharpoly"
805 "nc_degree"
806 "new-disrep"
807 "newcontext"
808 "newdet"
809 "newton"
810 "niceindices"
811 "nonscalarp"
812 "nostring"
813 "nounify"
814 "nroots"
815 "nterms"
816 "ntermsg"
817 "ntermsrci"
818 "nthroot"
819 "num"
820 "numberp"
821 "numerval"
822 "numfactor"
823 "nusum"
824 "nzeta"
825 "oddp"
826 "ode"
827 "ode2"
828 "openplot_curves"
829 "optimize"
830 "orbit"
831 "ordergreat"
832 "ordergreatp"
833 "orderless"
834 "orderlessp"
835 "outchar"
836 "outofpois"
837 "pade"
838 "part"
839 "part2cont"
840 "partfrac"
841 "partition"
842 "partpol"
843 "pcoeff"
844 "permanent"
845 "permut"
846 "pickapart"
847 "playback"
848 "plog"
849 "plot2d"
850 "plot2d"
851 "plot2d_ps"
852 "plot3d"
853 "plot3d"
854 "poisdiff"
855 "poisexpt"
856 "poisint"
857 "poismap"
858 "poisplus"
859 "poissimp"
860 "poissubst"
861 "poistimes"
862 "poistrim"
863 "polarform"
864 "polartorect"
865 "polynome2ele"
866 "potential"
867 "powers"
868 "powerseries"
869 "pred"
870 "prime"
871 "primep"
872 "print"
873 "printpois"
874 "printprops"
875 "prodrac"
876 "product"
877 "properties"
878 "props"
879 "propvars"
880 "pscom"
881 "psdraw_curve"
882 "psi"
883 "pui"
884 "pui2comp"
885 "pui2ele"
886 "pui2polynome"
887 "puireduc"
888 "pui_direct"
889 "put"
890 "qput"
891 "quit"
892 "qunit"
893 "quotient"))
896 (defvar maxima-match-functions-5
897 (concat "\\<\\("
898 (eval-when-compile (regexp-opt maxima-fns-5))
899 "\\)\\>")
900 "regexp to match the maxima functions.")
902 (defvar maxima-fns-6
903 (list
904 "radcan"
905 "radsubstflag"
906 "raiseriemann"
907 "random"
908 "rank"
909 "rat"
910 "ratcoef"
911 "ratdenom"
912 "ratdiff"
913 "ratdisrep"
914 "ratexpand"
915 "ratnumer"
916 "ratnump"
917 "ratp"
918 "ratsimp"
919 "ratsubst"
920 "ratvars"
921 "ratweight"
922 "read"
923 "readonly"
924 "realpart"
925 "realroots"
926 "rearray"
927 "rectform"
928 "recttopolar"
929 "rem"
930 "remainder"
931 "remarray"
932 "rembox"
933 "remcon"
934 "remfunction"
935 "remlet"
936 "remove"
937 "remrule"
938 "remtrace"
939 "remvalue"
940 "rename"
941 "reset"
942 "residue"
943 "resolvante"
944 "resolvante_alternee1"
945 "resolvante_bipartite"
946 "resolvante_diedrale"
947 "resolvante_klein"
948 "resolvante_klein3"
949 "resolvante_produit_sym"
950 "resolvante_unitaire"
951 "resolvante_vierer"
952 "rest"
953 "restore"
954 "resultant"
955 "return"
956 "reveal"
957 "reverse"
958 "revert"
959 "rhs"
960 "riccicom"
961 "riemann"
962 "rinvariant"
963 "risch"
964 "rncombine"
965 "romberg"
966 "room"
967 "rootscontract"
968 "row"
969 "save"
970 "scalarp"
971 "scalefactors"
972 "scanmap"
973 "schur2comp"
974 "sconcat"
975 "scsimp"
976 "scurvature"
977 "sec"
978 "sech"
979 "setelmx"
980 "setup"
981 "setup_autoload"
982 "set_plot_option"
983 "set_up_dot_simplifications"
984 "showratvars"
985 "sign"
986 "signum"
987 "similaritytransform"
988 "simp"
989 "sin"
990 "sinh"
991 "solve"
992 "somrac"
993 "sort"
994 "splice"
995 "sprint"
996 "sqfr"
997 "sqrt"
998 "srrat"
999 "sstatus"
1000 "status"
1001 "string"
1002 "stringout"
1003 "sublis"
1004 "sublist"
1005 "submatrix"
1006 "subst"
1007 "substinpart"
1008 "substpart"
1009 "subvarp"
1010 "sum"
1011 "sumcontract"
1012 "supcontext"
1013 "sym"
1014 "symbolp"
1015 "system"
1016 "tan"
1017 "tanh"
1018 "taylor"
1019 "taylorinfo"
1020 "taylorp"
1021 "taylor_simplifier"
1022 "taytorat"
1023 "tcl_output"
1024 "tcontract"
1025 "tellrat"
1026 "tellsimp"
1027 "tellsimpafter"
1028 "tex"
1029 "throw"
1030 "time"
1031 "timer"
1032 "timer_info"
1033 "tldefint"
1034 "tlimit"
1035 "tobreak"
1036 "todd_coxeter"
1037 "toplevel"
1038 "totaldisrep"
1039 "totient"
1040 "to_lisp"
1041 "tpartpol"
1042 "trace"
1043 "trace_options"
1044 "transform"
1045 "translate"
1046 "translate_file"
1047 "transpose"
1048 "treillis"
1049 "treinat"
1050 "triangularize"
1051 "trigexpand"
1052 "trigrat"
1053 "trigreduce"
1054 "trigsimp"
1055 "trunc"
1056 "tr_warnings_get"
1057 "tsetup"
1058 "ttransform"
1059 "undiff"
1060 "uniteigenvectors"
1061 "unitvector"
1062 "unknown"
1063 "unorder"
1064 "unsum"
1065 "untellrat"
1066 "untrace"
1067 "vectorpotential"
1068 "vectorsimp"
1069 "verbify"
1070 "weyl"
1071 "writefile"
1072 "xthru"
1073 "zeroequiv"
1074 "zeromatrix"
1075 "zeta"
1076 "zrpoly"
1077 "zsolve"))
1080 (defvar maxima-match-functions-6
1081 (concat "\\<\\("
1082 (eval-when-compile (regexp-opt maxima-fns-6))
1083 "\\)\\>")
1084 "regexp to match the maxima functions.")
1086 (defvar maxima-const-1
1087 (list
1088 "%e"
1089 "%pi"))
1092 (defvar maxima-match-constants-1
1093 (concat "\\<"
1094 (eval-when-compile (regexp-opt maxima-const-1))
1095 "\\>")
1096 "regexp to match the maxima constants.")
1098 (defvar maxima-const-2
1099 (list
1100 "false"
1101 "inf"
1102 "infinity"
1103 "minf"
1104 "true"))
1106 (defvar maxima-match-constants-2
1107 (concat "\\<\\("
1108 (eval-when-compile (regexp-opt maxima-const-2))
1109 "\\)\\>")
1110 "regexp to match the maxima constants.")
1112 (defvar maxima-match-constants-3
1113 "\\<\\([0-9]+\\)\\>"
1114 "regexp to match the maxima constants.")
1116 (defvar maxima-match-constants-4
1117 "\\<\\([0-9]+\.\\)?\\([0-9]+b[+-]?[0-9]\\)\\>"
1118 "regexp to match the maxima constants.")
1120 (defvar maxima-keywds
1121 (list
1122 "allbut"))
1124 (defvar maxima-match-keywords
1125 (concat "\\<\\("
1126 (eval-when-compile (regexp-opt maxima-keywds))
1127 "\\)\\>")
1128 "regexp to match the maxima keywords.")
1130 (defvar maxima-match-operators
1131 (eval-when-compile
1132 (regexp-opt '(
1134 "''"
1136 "!!"
1140 "::"
1141 "::="
1142 ":="
1151 ) t))
1152 "regexp to match the maxima operators.")
1154 (defvar maxima-props
1155 (list
1156 "atomgrad"))
1159 (defvar maxima-match-properties
1160 (concat "\\<\\("
1161 (eval-when-compile (regexp-opt maxima-props))
1162 "\\)\\>")
1163 "regexp to match maxima properties.")
1165 (defvar maxima-macros
1166 (list
1167 "buildq"
1168 "with_stdout"))
1171 (defvar maxima-match-macros
1172 (concat "\\<\\("
1173 (eval-when-compile (regexp-opt maxima-macros))
1174 "\\)\\>")
1175 "regexp to match maxima macros.")
1177 (defvar maxima-specops
1178 (list
1179 "do"
1180 "else"
1181 "for"
1182 "if"
1183 "in"
1184 "step"
1185 "then"
1186 "thru"
1187 "unless"
1188 "while"))
1191 (defvar maxima-match-specops
1192 (concat "\\<\\("
1193 (eval-when-compile (regexp-opt maxima-specops))
1194 "\\)\\>")
1195 "regexp to match maxima special operators.")
1197 (defvar maxima-decs
1198 (list
1199 "alphabetic"
1200 "antisymmetric"
1201 "commutative"
1202 "feature"
1203 "features"
1204 "lassociative"
1205 "linear"
1206 "mainvar"
1207 "multiplicative"
1208 "nonscalar"
1209 "noun"
1210 "outative"
1211 "posfun"
1212 "rassociative"
1213 "symmetric"))
1216 (defvar maxima-match-declarations
1217 (concat "\\<\\("
1218 (eval-when-compile (regexp-opt maxima-decs))
1219 "\\)\\>")
1220 "regexp to match maxima declarations.")
1222 (defvar maxima-spsymbs-1
1223 (list
1224 "additive"
1225 "constant"
1226 "infeval"
1227 "noeval"
1228 "nouns"
1229 "numer"
1230 "poisson"
1231 "verb"))
1234 (defvar maxima-match-specsymbs-1
1235 (concat "\\<\\("
1236 (eval-when-compile (regexp-opt maxima-spsymbs-1))
1237 "\\)\\>")
1238 "regexp to match maxima special symbols.")
1240 (defvar maxima-match-specsymbs-2
1241 "\\(\\<\\?\\sw+\\>\\)"
1242 "regexp to match maxima special symbols.")
1244 ;;; now, create the faces.
1246 ;; (defface maxima-function-face
1247 ;; '((((type tty) (class color)) (:foreground "blue" :weight bold))
1248 ;; (((class color) (background light)) (:foreground "blue" :weight bold))
1249 ;; (((class color) (background dark)) (:foreground "lightskyblue" :weight bold))
1250 ;; (t (:inverse-video t :bold t)))
1251 ;; "font lock mode face used to highlight function names."
1252 ;; :group 'maxima)
1254 ;; (defface maxima-constant-face
1255 ;; '((((type tty) (class color)) (:foreground "magenta"))
1256 ;; (((class grayscale) (background light))
1257 ;; (:foreground "lightgray" :bold t :underline t))
1258 ;; (((class grayscale) (background dark))
1259 ;; (:foreground "gray50" :bold t :underline t))
1260 ;; (((class color) (background light)) (:foreground "cadetblue" :weight bold))
1261 ;; (((class color) (background dark)) (:foreground "aquamarine" :weight bold))
1262 ;; (t (:bold t :underline t)))
1263 ;; "font lock mode face used to highlight constants and labels."
1264 ;; :group 'maxima)
1266 ;; (defface maxima-keyword-face
1267 ;; '((((type tty) (class color)) (:foreground "cyan" :weight bold))
1268 ;; (((class grayscale) (background light)) (:foreground "lightgray" :bold t))
1269 ;; (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
1270 ;; (((class color) (background light)) (:foreground "purple" :weight bold))
1271 ;; (((class color) (background dark)) (:foreground "cyan" :weight bold))
1272 ;; (t (:bold t)))
1273 ;; "font lock mode face used to highlight keywords."
1274 ;; :group 'maxima)
1276 ;; (defface maxima-operator-face
1277 ;; '((((type tty) (class color)) (:foreground "blue" :weight light))
1278 ;; (((class grayscale) (background light)) (:foreground "lightgray" :bold t))
1279 ;; (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
1280 ;; (((class color) (background light)) (:foreground "orchid" :weight bold))
1281 ;; (((class color) (background dark)) (:foreground "lightsteelblue" :weight bold))
1282 ;; (t (:bold t)))
1283 ;; "font lock mode face used to highlight builtins."
1284 ;; :group 'maxima)
1286 ;; (defface maxima-property-face
1287 ;; '((((type tty) (class color)) (:foreground "green"))
1288 ;; (((class grayscale) (background light)) (:foreground "gray90" :bold t))
1289 ;; (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
1290 ;; (((class color) (background light)) (:foreground "forestgreen" :weight bold))
1291 ;; (((class color) (background dark)) (:foreground "palegreen" :weight bold))
1292 ;; (t (:bold t :underline t)))
1293 ;; "font lock mode face used to highlight type and classes."
1294 ;; :group 'maxima)
1296 ;; (defface maxima-macro-face
1297 ;; '((((class color) (background dark)) (:foreground "steelblue1"))
1298 ;; (((class color) (background light)) (:foreground "blue3"))
1299 ;; (t (:underline t)))
1300 ;; "font lock mode face used to highlight preprocessor conditionals."
1301 ;; :group 'maxima)
1303 ;; (defface maxima-specop-face
1304 ;; '((((type tty) (class color)) (:foreground "cyan" :weight bold))
1305 ;; (((class grayscale) (background light)) (:foreground "lightgray" :bold t))
1306 ;; (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
1307 ;; (((class color) (background light)) (:foreground "purple" :weight bold))
1308 ;; (((class color) (background dark)) (:foreground "cyan" :weight bold))
1309 ;; (t (:bold t)))
1310 ;; "font lock mode face used to highlight keywords."
1311 ;; :group 'maxima)
1313 ;; (defface maxima-declaration-face
1314 ;; '((((type tty) (class color)) (:foreground "cyan" :weight bold))
1315 ;; (((class grayscale) (background light)) (:foreground "lightgray" :bold t))
1316 ;; (((class grayscale) (background dark)) (:foreground "dimgray" :bold t))
1317 ;; (((class color) (background light)) (:foreground "purple" :weight bold))
1318 ;; (((class color) (background dark)) (:foreground "cyan" :weight bold))
1319 ;; (t (:bold t)))
1320 ;; "font lock mode face used to highlight keywords."
1321 ;; :group 'maxima)
1323 ;; (defface maxima-specsymb-face
1324 ;; '((((type tty) (class color)) (:foreground "red"))
1325 ;; (((class color) (background light)) (:foreground "red" :bold t))
1326 ;; (((class color) (background dark)) (:foreground "pink" :bold t))
1327 ;; (t (:inverse-video t :bold t)))
1328 ;; "font lock mode face used to highlight warnings."
1329 ;; :group 'maxima)
1331 ;; (defface maxima-variable-face
1332 ;; '((((type tty) (class color)) (:foreground "yellow" :weight light))
1333 ;; (((class grayscale) (background light))
1334 ;; (:foreground "gray90" :bold t :italic t))
1335 ;; (((class grayscale) (background dark))
1336 ;; (:foreground "dimgray" :bold t :italic t))
1337 ;; (((class color) (background light)) (:foreground "darkgoldenrod" :italic t))
1338 ;; (((class color) (background dark)) (:foreground "lightgoldenrod" :italic t))
1339 ;; (t (:bold t :italic t)))
1340 ;; "font lock mode face used to highlight variable names."
1341 ;; :group 'maxima)
1343 ;;; now, the keywords
1344 (unless (facep 'font-lock-builtin-face)
1345 (copy-face 'font-lock-keyword-face 'font-lock-builtin-face))
1347 (unless (facep 'font-lock-constant-face)
1348 (copy-face 'font-lock-keyword-face 'font-lock-constant-face))
1350 (defvar maxima-font-lock-keywords-1
1352 (,maxima-match-declarations . font-lock-keyword-face))
1353 "Subdued level highlighting for Maxima mode.")
1355 (defvar maxima-font-lock-keywords-2
1356 (append maxima-font-lock-keywords-1
1358 (,maxima-match-operators . font-lock-keyword-face)
1359 (,maxima-match-variables-1 . font-lock-keyword-face)
1360 (,maxima-match-variables-2 . font-lock-keyword-face)
1361 (,maxima-match-variables-3 . font-lock-keyword-face)
1362 (,maxima-match-variables-4 . font-lock-keyword-face)
1363 (,maxima-match-functions-1 . font-lock-builtin-face)
1364 (,maxima-match-functions-2 . font-lock-builtin-face)
1365 (,maxima-match-functions-3 . font-lock-builtin-face)
1366 (,maxima-match-functions-4 . font-lock-builtin-face)
1367 (,maxima-match-functions-5 . font-lock-builtin-face)
1368 (,maxima-match-functions-6 . font-lock-builtin-face)
1369 (,maxima-match-constants-1 . font-lock-constant-face)
1370 (,maxima-match-constants-2 . font-lock-constant-face)
1371 (,maxima-match-constants-3 . font-lock-constant-face)
1372 (,maxima-match-constants-4 . font-lock-constant-face)
1373 (,maxima-match-keywords . font-lock-keyword-face)
1374 (,maxima-match-properties . font-lock-keyword-face)
1375 (,maxima-match-macros . font-lock-keyword-face)
1376 (,maxima-match-specops . font-lock-keyword-face)
1377 (,maxima-match-specsymbs-1 . font-lock-keyword-face)
1378 (,maxima-match-specsymbs-2 . font-lock-keyword-face)))
1379 "Medium level highlighting for Maxima mode.")
1381 (defvar maxima-font-lock-keywords-3
1382 (append maxima-font-lock-keywords-2
1383 (list
1384 (list "^\\(.*\\)(\\(.*\\)) *:="
1385 '(1 font-lock-function-name-face))
1386 (list "^.*(\\(.*\\)):="
1387 '(1 font-lock-variable-name-face))))
1388 "Gaudy level highlighting for Maxima mode.")
1390 (defvar maxima-font-lock-keywords maxima-font-lock-keywords-1
1391 "Default expressions to highlight in Maxima mode.")
1393 (defun maxima-font-setup ()
1394 (make-local-variable 'font-lock-defaults)
1395 (setq font-lock-defaults
1396 '((maxima-font-lock-keywords maxima-font-lock-keywords-1
1397 maxima-font-lock-keywords-2 maxima-font-lock-keywords-3)
1398 nil t)))
1400 (add-hook 'maxima-mode-hook 'maxima-font-setup)
1402 ;;; A function to fontify the preamble in a Maxima process buffer
1403 (defvar maxima-preamble-fontlock t)
1405 (defun maxima-match-preamble (limit)
1406 "Used to fontify the preamble."
1407 (if maxima-preamble-fontlock
1408 (progn
1409 (setq maxima-preamble-fontlock nil)
1410 (let ((beg (point-min))
1411 (end))
1412 (if (search-forward "(C1)" limit)
1413 (progn
1414 (forward-line -1)
1415 (setq end (maxima-line-end-position))
1416 (store-match-data (list beg end))
1417 t))))
1418 nil))
1420 (defvar inferior-maxima-font-lock-keywords-1
1421 (append maxima-font-lock-keywords-1
1422 '((maxima-match-preamble (0 font-lock-string-face t t)))))
1424 (defvar inferior-maxima-font-lock-keywords-2
1425 (append maxima-font-lock-keywords-2
1426 '((maxima-match-preamble (0 font-lock-string-face t t)))))
1428 (defvar inferior-maxima-font-lock-keywords-3
1429 (append maxima-font-lock-keywords-3
1430 '((maxima-match-preamble (0 font-lock-string-face t t)))))
1432 (defvar inferior-maxima-font-lock-keywords inferior-maxima-font-lock-keywords-1
1433 "Default expressions to highlight in Maxima mode.")
1435 (defun inferior-maxima-font-setup ()
1436 (make-local-variable 'font-lock-defaults)
1437 (setq font-lock-defaults
1438 '((inferior-maxima-font-lock-keywords inferior-maxima-font-lock-keywords-1
1439 inferior-maxima-font-lock-keywords-2 inferior-maxima-font-lock-keywords-3)
1440 nil t)))
1442 ;;; now for the symbols
1444 (defvar maxima-symbols
1445 (mapcar
1446 (lambda (x) (list x))
1447 (append
1448 maxima-vars-1
1449 maxima-vars-2
1450 maxima-vars-3
1451 maxima-vars-4
1452 maxima-fns-1
1453 maxima-fns-2
1454 maxima-fns-3
1455 maxima-fns-4
1456 maxima-fns-5
1457 maxima-fns-6
1458 maxima-const-1
1459 maxima-const-2
1460 maxima-keywds
1461 maxima-props
1462 maxima-macros
1463 maxima-specops
1464 maxima-decs
1465 maxima-spsymbs-1)))
1467 ;;; end of maxima-font-lock.el