[GAP Forum] GAP mode for emacs
Rafael
rvf0068 at gmail.com
Tue Aug 24 01:39:29 BST 2010
Ivan Andrus <darthandrus at gmail.com>
writes:
> I have been using gap-mode for emacs version 1.96 by Michael Smith.
> There are a few things that I would like to add, principally syntax
> highlighting. Has anyone else done this that I couldn't find? Would
> there be interest in an updated version with some improvements?
This is what I use. It is really far from perfect, but it is something...
(defun add-custom-keyw()
"adds a few special keywords for gap mode"
(font-lock-add-keywords nil
'(
("\\bif\\b\\|then\\|else\\|elseif" . 'font-lock-keyword-face )
("while\\|\\bdo\\b\\|\\bfi\\b" . 'font-lock-keyword-face )
("\\bend\\b\\|return\\|\\bnot\\b\\|function\\|\\blocal\\b" . 'font-lock-keyword-face )
("\\bfor\\b\\|\\bin\\b\\|\\bod\\b\\|\\bmod\\b\\|\\band\\b" . 'font-lock-keyword-face )
("true\\|false" . 'font-lock-constant-face )
("Print\\|Length\\|\\bOrbits\\b\\|Subsets\\|Difference" . 'font-lock-function-name-face )
("List\\|OnSets\\|Group\\|Intersection" . 'font-lock-function-name-face )
("IsTransitive\\|OnTuples\\|Concatenation\\|Filtered" . 'font-lock-function-name-face )
("Add\\|Sum\\|SymmetricGroup\\|Filtered\\|RightCosets" . 'font-lock-function-name-face )
("Eigenvalues\\|Rationals\\|" . 'font-lock-function-name-face )
("\\bCharacteristicPolynomial\\b" . 'font-lock-function-name-face )
("Filtered\\|RightCosets" . 'font-lock-function-name-face )
("#.*" . font-lock-comment-face)
)))
(add-hook 'gap-mode-hook 'add-custom-keyw)
More information about the Forum
mailing list