lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wednesday, October 28, 1998 4:05 PM, mtigges@cpsc.ucalgary.ca
[SMTP:mtigges@cpsc.ucalgary.ca] wrote:
> If anyone has a lua-mode.el for emacs I would be most appreciative if
> you could share the wealth.  Otherwise I will begin writing a simple one. 

I would also appreciate a proper lua mode. Currently I am using the
following code, which works fine in GNU Emacs 19.34

Thomas

------------------------------------>
;;; Lua
(defun lua-mode ()
  "Lua mode"
  (interactive)
  (setq tab-width 4
	;; this will make sure that tabs are used instead of spaces
	indent-tabs-mode t)
  (font-lock-mode nil)
  (setq font-lock-keywords
	'(
	  ("[^\\\\]\\(\\(\".*\"\\)\\|\\('.*'\\)\\)"
	   . font-lock-string-face)
	  ("--.*$"
	   . font-lock-comment-face)
	  ("^[$][^ \\t]*"
	   . font-lock-preprocesspr-face)  ; evil spelling mistake!!!!
	  ("\\([^_]\\|^\\)\\<\\(and\\|do\\|else\\|elseif\\|end\\|\
repeat\\|return\\|then\\|until\\|while\\|\
if\\|local\\|nil\\|not\\|or\\)\\>\\([^_]\\|$\\)"
	   . font-lock-keyword-face)
	  ("^[ \\t]*function[^(]*"
	   . font-lock-function-name-face)
	  ))
  (font-lock-fontify-buffer))
(setq auto-mode-alist (append '((".*\\.lua" . lua-mode)) auto-mode-alist))
<--------------------------------------