Commits

Rob Simmons committed bfa9a00 Merge

Merge from master

Comments (0)

Files changed (2)

 
 The authors of the program are Matija Pretnar <matija@pretnar.info>,
 and Andrej Bauer <Andrej.Bauer@andrej.com>, with modifications by
-Robert Simmons <robsimmons@gmail.com>.  See the file COPYRIGHT.txt for 
-license information.
+Robert Simmons <robsimmons@gmail.com>. Emacs mode by Ben Mosley. 
+See the file COPYRIGHT.txt for license information.
+
 
 3. REQUIREMENTS
 
 If you have an older version of Objective Caml you can still compile
 the code by hand.
 
+A simple emacs highlighting mode for Levy is included; you can include it by 
+adding the following text to your .emacs file, changing the levy-root directory
+to wherever the code for Levy was placed.
+
+;; Setup for levy-mode
+(setq levy-root "/home/hqbovik/levy/")
+(load (concat levy-root "levy.el"))
+(add-to-list 'auto-mode-alist '("\\.levy\\'" . levy-mode))
+
 
 4. COMPILATION
 
+(require 'generic-x) ;; we need this
+
+(define-generic-mode
+      'levy-mode                        ;; name of the mode to create
+      '("#")                            ;; comments start with '!!'
+      '("if" "then" "else"
+        "fun")                          ;; some keywords
+      '(("->" . 'font-lock-constant-face)
+        (":" . 'font-lock-constant-face)
+        ("return" . 'font-lock-builtin-face)
+        ("thunk" . 'font-lock-builtin-face)
+        ("force" . 'font-lock-builtin-face)
+        ("do" . 'font-lock-function-name-face)
+        ("let" . 'font-lock-function-name-face)
+	)
+      '("\\.levy$")                     ;; files for which to activate this mode
+       nil                              ;; other functions to call
+      "A mode for Levy files"           ;; doc string for this mode
+    )