-
Notifications
You must be signed in to change notification settings - Fork 3
/
M2-symbols.el.in
39 lines (32 loc) · 1.58 KB
/
M2-symbols.el.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
;; use this function with C-h f to discover which instance and version of this file is loaded
(defun M2-version () "@M2VERSION@" "The corresponding Macaulay2 version number for the loaded Macaulay2 major mode.")
(defconst M2-symbols
'( @M2SYMBOLS@ )
"A list of the symbols available in Macaulay2, for use with dynamic completion." )
(let ((max-specpdl-size 1000)) ; needed for passing long long lists to regexp-opt
(defconst M2-keyword-regexp (regexp-opt '( @M2KEYWORDS@ ) 'words)
"Regular expression for Macaulay2 keywords")
(defconst M2-type-regexp (regexp-opt '( @M2DATATYPES@ ) 'words)
"Regular expression for Macaulay2 types")
(defconst M2-function-regexp (regexp-opt '( @M2FUNCTIONS@ ) 'words)
"Regular expression for Macaulay2 functions")
(defconst M2-constant-regexp (regexp-opt '( @M2CONSTANTS@ ) 'words)
"Regular expression for Macaulay2 constants"))
(defconst M2-comint-prompt-regexp "^\\([ \t]*\\(i*[1-9][0-9]* :\\|o*[1-9][0-9]* =\\) \\)?"
"Regular expression for the Macaulay2 prompt")
(defconst M2-mode-font-lock-keywords
(list
(cons M2-keyword-regexp 'font-lock-keyword-face)
(cons M2-type-regexp 'font-lock-type-face)
(cons M2-function-regexp 'font-lock-function-name-face)
(cons M2-constant-regexp 'font-lock-constant-face)))
; TODO:
; font-lock-warning-face
; font-lock-variable-name-face
; font-lock-builtin-face
; font-lock-preprocessor-face
; font-lock-doc-face
; font-lock-negation-char-face
(if (fboundp 'font-lock-add-keywords)
(font-lock-add-keywords 'M2-mode M2-mode-font-lock-keywords 'set))
(provide 'M2-symbols)