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