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