[Grace-core] Most up-to-date Grace emacs mode
Kim Bruce
kim at cs.pomona.edu
Sat May 9 17:04:45 PDT 2015
I’m upgrading to a new computer, trying to get everything set up. I’m trying to figure out if I have the most up-to-date version of the grace emacs mode (grace-generic-model.el). I’ve attached the file I’m using. Please let me know if that is the most up-to-date version or send me the new one if this is out-of-date.
Kim
;; Grace-Generic-Mode
;; An attempt at a generic mode for editing Grace files,
;; based on generic-mode.
(require 'generic-x)
(define-generic-mode 'grace-generic-mode
'("!!") ;; can't get comments to work
'("assert" "self" "true" "false" "catch" "raise" "return" "method" "const" "def" "var" "object" "class" "type" "prefix" "where" "super" "outer" "finally" "using" "inherits" "extends")
'((":=" . 'font-lock-builtin-face)
("=" . 'font-lock-builtin-face)
(";" . 'font-lock-builtin-face)
("{" . 'font-lock-builtin-face)
("}" . 'font-lock-builtin-face)
(":" . 'font-lock-builtin-face)
("->" . 'font-lock-builtin-face)
)
'(".grace\\'" ".grc\\'")
'( (lambda () (grace-mode-startup)) )
"Generic mode for editing Grace programs, see http://gracelang.org")
(defun grace-untabify-buffer ()
"untabifies the whole buffer"
(interactive "")
(msg "running grace-untabify-buffer")
(save-excursion
(mark-whole-buffer)
(untabify (region-beginning) (region-end))
))
(defun grace-mode-startup ()
"start up grace model"
(msg "running grace-mode-startup")
(add-hook 'before-save-hook 'grace-untabify-buffer)
)
More information about the Grace-core
mailing list