File: lua-mode.el.html

lua-mode provides support for editing Lua, including automatic indentation, syntactical font-locking, running interactive shell, Flymake checks with luacheck, interacting with hs-minor-mode(var)/hs-minor-mode(fun) and online documentation lookup.

The following variables are available for customization (see more via
`M-x customize-group lua`):

- Var lua-indent-level:
  indentation offset in spaces
- Var lua-indent-string-contents:
  set to `t` if you like to have contents of multiline strings to be
  indented like comments
- Var lua-indent-nested-block-content-align:
  set to nil to stop aligning the content of nested blocks with the
  open parenthesis
- Var lua-indent-close-paren-align:
  set to t to align close parenthesis with the open parenthesis,
  rather than with the beginning of the line
- Var lua-mode-hook:
  list of functions to execute when lua-mode is initialized
- Var lua-documentation-url:
  base URL for documentation lookup
- Var lua-documentation-function: function used to
  show documentation (`eww` is a viable alternative for Emacs 25)

These are variables/commands that operate on the Lua process:

- Var lua-default-application:
  command to start the Lua process (REPL)
- Var lua-default-command-switches:
  arguments to pass to the Lua process on startup (make sure `-i` is
  there if you expect working with Lua shell interactively)
- Cmd lua-start-process: start new REPL process, usually happens
  automatically
- Cmd lua-kill-process: kill current REPL process

These are variables/commands for interaction with the Lua process:

- Cmd lua-show-process-buffer: switch to REPL buffer
- Cmd lua-hide-process-buffer: hide window showing REPL buffer
- Var lua-always-show: show REPL buffer after sending something
- Cmd lua-send-buffer: send whole buffer
- Cmd lua-send-current-line: send current line
- Cmd lua-send-defun: send current top-level function
- Cmd lua-send-region: send active region
- Cmd lua-restart-with-whole-file: restart REPL and send whole buffer

To enable on-the-fly linting, make sure you have the luacheck program installed (available from luarocks) and activate flymake-mode(var)/flymake-mode(fun).

See "M-x apropos-command ^lua-" for a list of commands. See "M-x customize-group lua" for a list of customizable variables.

Defined variables (37)

lua--beginning-of-defun-reLua top level (matches only at the beginning of line) function header regex.
lua--builtinsA regexp that matches Lua builtin functions & variables.
lua--left-shifter-regexpRegular expression that matches left-shifter expression.
lua-always-showNon-nil means display ‘lua-process-buffer’ after sending a command.
lua-block-token-alistThis is a list of block token information blocks.
lua-comment-startDefault value of ‘comment-start’.
lua-comment-start-skipDefault value of ‘comment-start-skip’.
lua-cont-bol-regexpRegexp that matches a line that continues previous one.
lua-cont-eol-regexpRegexp that matches the ending of a line that needs continuation.
lua-default-applicationDefault application to run in Lua process.
lua-default-command-switchesCommand switches for ‘lua-default-application’.
lua-documentation-functionFunction used to fetch the Lua reference manual.
lua-documentation-urlURL pointing to the Lua reference manual.
lua-electric-flagNon-nil means electric actions are enabled.
lua-font-lock-keywordsDefault expressions to highlight in Lua mode.
lua-imenu-generic-expressionImenu generic expression for ‘lua-mode’.
lua-indent-close-paren-alignControls how closing parenthesis is aligned.
lua-indent-levelAmount by which Lua subexpressions are indented.
lua-indent-nested-block-content-alignControls how the content of nested blocks are indented.
lua-indent-string-contentsIf non-nil, contents of multiline string will be indented.
lua-jump-on-tracebackJump to innermost traceback location in *lua* buffer.
lua-luacheck-programName of the luacheck executable.
lua-mode-abbrev-tableAbbreviation table used in ‘lua-mode’ buffers.
lua-mode-hookHooks called when Lua mode fires up.
lua-mode-mapKeymap used in ‘lua-mode’ buffers.
lua-mode-menuMenu bar entry for ‘lua-mode’.
lua-mode-syntax-table‘lua-mode’ syntax table.
lua-prefix-keyPrefix for all ‘lua-mode’ commands.
lua-prefix-mode-mapKeymap that is used to define keys accessible by ‘lua-prefix-key’.
lua-processThe active Lua process.
lua-process-bufferBuffer used for communication with the Lua process.
lua-process-buffer-nameName of the inferior Lua buffer.
lua-process-history-fileFile used to save command history of the inferior Lua process.
lua-process-startfileStart file to load into the inferior Lua process at startup.
lua-prompt-regexpRegexp which matches the Lua program’s prompt.
lua-region-endEnd of special region for Lua communication.
lua-region-startStart of special region for Lua communication.

Defined functions (79)

lua--backward-up-list-noerror()
lua--containing-double-hyphen-start-pos()
lua--continuation-breaking-line-p()
lua--customize-set-prefix-key(PREFIX-KEY-SYM PREFIX-KEY-VAL)
lua--ensure-point-within-limit(LIMIT BACKWARD)
lua--escape-from-string(&optional BACKWARD)
lua--fill-paragraph(&optional JUSTIFY REGION)
lua--funcname-char-p(C)
lua--goto-line-beginning-rightmost-closer(&optional PARSE-START)
lua--propertize-multiline-bounds(START END)
lua--signum(X)
lua-accumulate-indentation-info(REVERSED-INDENTATION-INFO)
lua-add-indentation-info-pair(PAIR INFO-LIST)
lua-backward-up-list()
lua-backwards-to-block-begin-or-end()
lua-beginning-of-proc(&optional ARG)
lua-calculate-indentation()
lua-calculate-indentation-block-modifier(&optional PARSE-END)
lua-calculate-indentation-info(&optional PARSE-END)
lua-calculate-indentation-info-1(INDENTATION-INFO BOUND)
lua-calculate-indentation-override(&optional PARSE-START)
lua-calculate-string-or-comment-indentation()
lua-comment-or-string-p(&optional POS)
lua-comment-or-string-start-pos(&optional POS)
lua-comment-start-pos(&optional PARSING-STATE)
lua-electric-match(ARG)
lua-end-of-proc(&optional ARG)
lua-find-matching-token-word(TOKEN &optional DIRECTION)
lua-find-regexp(DIRECTION REGEXP &optional LIMIT)
lua-first-token-continues-p()
lua-flymake(REPORT-FN &rest ARGS)
lua-forward-line-skip-blanks(&optional BACK)
lua-forward-sexp(&optional COUNT)
lua-funcname-at-point()
lua-get-block-token-info(TOKEN)
lua-get-create-process()
lua-get-token-match-re(TOKEN-INFO DIRECTION)
lua-get-token-type(TOKEN-INFO)
lua-goto-matching-block(&optional NOREPORT)
lua-goto-matching-block-token(&optional PARSE-START DIRECTION)
lua-hide-process-buffer()
lua-indent-line()
lua-is-continuing-statement-p(&optional PARSE-START)
lua-is-continuing-statement-p-1()
lua-kill-process()
lua-last-token-continues-p()
lua-make-indentation-info-pair(FOUND-TOKEN FOUND-POS)
lua-make-lua-string(STR)
lua-match-multiline-literal-bounds(LIMIT)
lua-maybe-skip-shebang-line(START)
lua-mode()
lua-mode-menu(ARG1)
lua-point-is-after-left-shifter-p()
lua-prefix-key-update-bindings()
lua-prompt-line()
lua-restart-with-whole-file()
lua-rx(&rest REGEXPS)
lua-rx-to-string(FORM &optional NO-GROUP)
lua-search-documentation()
lua-send-buffer()
lua-send-current-line()
lua-send-defun(POS)
lua-send-file(FILE)
lua-send-lua-region()
lua-send-proc(POS)
lua-send-region(START END)
lua-send-string(STR)
lua-set-lua-region-end(&optional ARG)
lua-set-lua-region-start(&optional ARG)
lua-set-prefix-key(NEW-KEY-STR)
lua-show-process-buffer()
lua-skip-ws-and-comments-backward(&optional LIMIT)
lua-skip-ws-and-comments-forward(&optional LIMIT)
lua-start-process(&optional NAME PROGRAM STARTFILE &rest SWITCHES)
lua-string-p(&optional POS)
lua-toggle-electric-state(&optional ARG)
lua-try-match-multiline-begin(LIMIT)
lua-try-match-multiline-end(END)
run-lua(&optional NAME PROGRAM STARTFILE &rest SWITCHES)

Defined faces (0)