3
votes

I like a lot the auto-complete mode in emacs..it works great with ruby, python, clojure, javascript, etc, etc..but not support lua..is possible made it support Lua in a easy way?...o require a lot of work, I was reading the haskell extension in

http://madscientist.jp/~ikegami/diary/20090215.html#p01

and I think than add Lua must be less difficult, anyone know how to do it?

Maybe if you know other autocomplete system for emacs with lua support would help me..I don't need something really complicate, only than my emac show me a list words predefined (maybe I would make a file with lua keywords and then emacs show it) and the words than I've used

1

1 Answers

3
votes

To get the basic auto-complete features just open the file auto-complete.el and add lua-mode to this definition:

(defcustom ac-modes
  '(emacs-lisp-mode
    lisp-interaction-mode
    c-mode cc-mode c++-mode
    java-mode clojure-mode scala-mode
    scheme-mode
    ocaml-mode tuareg-mode
    perl-mode cperl-mode python-mode ruby-mode
    ecmascript-mode javascript-mode js-mode js2-mode php-mode css-mode
    makefile-mode sh-mode fortran-mode f90-mode ada-mode
    xml-mode sgml-mode)
  "Major modes `auto-complete-mode' can run on."
  :type '(repeat symbol)
  :group 'auto-complete)

Eval the expression with C-x C-e or restart Emacs and next time you open a lua-buffer auto-complete mode will be active in it. If lua is supported by semantic I guess you can use the semantic backend for some fancier completion suggestions; for some more custom setup you should have a look at the excellent user manual.