;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\303\304!\210\303\305!\210\303\306!\210\307\310!\203#\311\312\313\314\315B\"\210\312\316\317\"\210\202B\312\316\320\"\210\312\313\314\321B\"\210\312\322\323\"\210\312\324\325\"\210\326 !\327\322\330\"\210\331\332\333\334\335\336\337\340&\210\341\342\343\344\345DD\346\347\350\337\332\351\352& \210\341\353\343\344\354DD\355\347\356\337\332&\210\341\357\343\344\360DD\361\347\356\337\332&\210\341\362\343\344\363DD\364\347\365\337\332&\210\341\366\343\344\367DD\370\347\371\337\332&\210\372\366!\210\341\373\343\344\374DD\375\347\376\337\332&\210\341\377\343\344\201@DD\201A\347\201B\201C\201D\307\201E!\205\316\201F\307\201G!\205\331\201H\201I#BB\337\332&\210\341\201J\343\344\201KDD\201L\347\356\337\332&\207" [lua--rx-bindings rx-constituents lua-rx-constituents require comint newcomment rx fboundp rx-let ((symbol (&rest x) (seq symbol-start (or x) symbol-end)) (ws (* (any " "))) (ws+ (+ (any " "))) (lua-name (symbol (seq (+ (any alpha "_")) (* (any alnum "_"))))) (lua-funcname (seq lua-name (* ws "." ws lua-name) (opt ws ":" ws lua-name))) (lua-funcheader (seq (or (seq (symbol "function") ws (group-n 1 lua-funcname)) (seq (group-n 1 lua-funcname) ws "=" ws (symbol "function"))))) (lua-number (seq (or (seq (+ digit) (opt ".") (* digit)) (seq (* digit) (opt ".") (+ digit))) (opt (regexp "[eE][+-]?[0-9]+")))) (lua-assignment-op (seq "=" (or buffer-end (not (any "="))))) (lua-operator (or "+" "-" "*" "/" "%" "^" "#" "==" "~=" "<=" ">=" "<" ">" "=" ";" ":" "," "." ".." "...")) (lua-keyword-operator (symbol "and" "not" "or")) (lua-keyword (symbol "break" "do" "else" "elseif" "end" "for" "function" "goto" "if" "in" "local" "repeat" "return" "then" "until" "while")) (lua-up-to-9-variables (seq (group-n 1 lua-name) ws (32 "," ws (group-n 2 lua-name) ws (32 "," ws (group-n 3 lua-name) ws (32 "," ws (group-n 4 lua-name) ws (32 "," ws (group-n 5 lua-name) ws (32 "," ws (group-n 6 lua-name) ws (32 "," ws (group-n 7 lua-name) ws (32 "," ws (group-n 8 lua-name) ws (32 "," ws (group-n 9 lua-name) ws))))))))))) defalias lua-rx macro #[128 "\301\302\303BE!\207" [lua--rx-bindings eval rx-let rx] 6 "\n\n(fn &rest REGEXPS)"] lua-rx-to-string #[513 "\302!\303\")\207" [lua--rx-bindings rx--local-definitions rx--extend-local-defs rx-to-string] 5 "\n\n(fn FORM &optional NO-GROUP)"] #[513 "\302\")\207" [lua-rx-constituents rx-constituents rx-to-string] 5 "Lua-specific replacement for `rx-to-string'.\n\nSee `rx-to-string' documentation for more information FORM and\nNO-GROUP arguments.\n\n(fn FORM &optional NO-GROUP)"] #[128 "\211\204\300\301!\207\211A\203\302\303B\304\"\207\302@\304\"\207" [error "No regexp" lua-rx-to-string and t] 4 "Lua-specific replacement for `rx'.\n\nSee `rx' documentation for more information about REGEXPS param.\n\n(fn &rest REGEXPS)"] lua--new-rx-form #[257 "\211A\211<\203\211@\301=\203\302A@\303\"\241\210B\211\207" [lua-rx-constituents :rx lua-rx-to-string nogroup] 6 "Add FORM definition to `lua-rx' macro.\n\nFORM is a cons (NAME . DEFN), see more in `rx-constituents' doc.\nThis function enables specifying new definitions using old ones:\nif DEFN is a list that starts with `:rx' symbol its second\nelement is itself expanded with `lua-rx-to-string'. \n\n(fn FORM)"] lua--rx-symbol #[257 "\211A\262\211G\301=\203\211@\202\302\303\"\262\304\305!\205&\305\306\307\310BBB\"\207" [rx-parent 1 append (or) fboundp rx-form seq symbol-start (symbol-end)] 6 "\n\n(fn FORM)"] copy-sequence mapc ((symbol lua--rx-symbol 1 nil) (ws . "[ ]*") (ws+ . "[ ]+") (lua-name :rx (symbol (regexp "[[:alpha:]_]+[[:alnum:]_]*"))) (lua-funcname :rx (seq lua-name (* ws "." ws lua-name) (opt ws ":" ws lua-name))) (lua-funcheader :rx (seq (or (seq (symbol "function") ws (group-n 1 lua-funcname)) (seq (group-n 1 lua-funcname) ws "=" ws (symbol "function"))))) (lua-number :rx (seq (or (seq (+ digit) (opt ".") (* digit)) (seq (* digit) (opt ".") (+ digit))) (opt (regexp "[eE][+-]?[0-9]+")))) (lua-assignment-op :rx (seq "=" (or buffer-end (not (any "="))))) (lua-operator :rx (or "+" "-" "*" "/" "%" "^" "#" "==" "~=" "<=" ">=" "<" ">" "=" ";" ":" "," "." ".." "...")) (lua-keyword-operator :rx (symbol "and" "not" "or")) (lua-keyword :rx (symbol "break" "do" "else" "elseif" "end" "for" "function" "goto" "if" "in" "local" "repeat" "return" "then" "until" "while")) (lua-up-to-9-variables :rx (seq (group-n 1 lua-name) ws (32 "," ws (group-n 2 lua-name) ws (32 "," ws (group-n 3 lua-name) ws (32 "," ws (group-n 4 lua-name) ws (32 "," ws (group-n 5 lua-name) ws (32 "," ws (group-n 6 lua-name) ws (32 "," ws (group-n 7 lua-name) ws (32 "," ws (group-n 8 lua-name) ws (32 "," ws (group-n 9 lua-name) ws))))))))))) custom-declare-group lua nil "Major mode for editing Lua code." :prefix "lua-" :group languages custom-declare-variable lua-indent-level funcall function #[0 "\300\207" [3] 1] "Amount by which Lua subexpressions are indented." :type integer :safe integerp lua-comment-start #[0 "\300\207" [#1="-- "] 1 #1#] "Default value of `comment-start'." string lua-comment-start-skip #[0 "\300\207" [#2="---*[ ]*"] 1 #2#] "Default value of `comment-start-skip'." lua-default-application #[0 "\300\207" [#3="lua"] 1 #3#] "Default application to run in Lua process.\n\nCan be a string, where it denotes a command to be executed to\nstart Lua process, or a (HOST . PORT) cons, that can be used to\nconnect to Lua process running remotely." (choice (string) (cons string integer)) lua-default-command-switches #[0 "\300C\207" ["-i"] 1] "Command switches for `lua-default-application'.\nShould be a list of strings." (repeat string) make-variable-buffer-local lua-always-show #[0 "\300\207" [t] 1] "*Non-nil means display lua-process-buffer after sending a command." boolean lua-documentation-function #[0 "\300\207" [browse-url] 1] "Function used to fetch the Lua reference manual." radio (function-item browse-url) append eww ((function-item eww)) w3m-browse-url ((function-item w3m-browse-url)) ((function :tag "Other function")) lua-documentation-url #[0 "\300\301!\203\302\207\303\207" [file-readable-p "/usr/share/doc/lua/manual.html" "file:///usr/share/doc/lua/manual.html" "http://www.lua.org/manual/5.1/manual.html"] 2] "URL pointing to the Lua reference manual."] 11) #@24 The active Lua process (defvar lua-process nil (#$ . 6371)) #@52 Buffer used for communication with the Lua process (defvar lua-process-buffer nil (#$ . 6437)) #@38 (fn PREFIX-KEY-SYM PREFIX-KEY-VAL) (defalias 'lua--customize-set-prefix-key #[514 "\205G\300V\205\301!\300\234L\210\302\303!\205\303 \207" [0 read-kbd-macro fboundp lua-prefix-key-update-bindings] 5 (#$ . 6538)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315& \207" [custom-declare-variable lua-prefix-key funcall function #[0 "\300\207" [#1=""] 1 #1#] "Prefix for all lua-mode commands." :type string :group lua :set lua--customize-set-prefix-key :get (lambda (sym) (let ((val (eval sym))) (if val (single-key-description (eval sym)) "")))] 12) #@29 Keymap for lua-mode's menu. (defvar lua-mode-menu (make-sparse-keymap "Lua") (#$ . 7128)) #@143 Keymap that is used to define keys accessible by `lua-prefix-key'. If the latter is nil, the keymap translates into `lua-mode-map' verbatim. (defvar lua-prefix-mode-map '(keymap (6 . lua-search-documentation) (12 . lua-send-buffer)) (#$ . 7225)) (defvar lua--electric-indent-chars (mapcar 'string-to-char '("}" "]" ")"))) #@34 Keymap used in lua-mode buffers. (defvar lua-mode-map (byte-code "\304 \305\306!\204\307\310\311\"\"\210\312\313\314 B#\210\312\315\316#\210\305\302!\203-\312\317\n! #\210\207\320 \"\210\207" [lua--electric-indent-chars lua-mode-menu lua-prefix-key lua-prefix-mode-map make-sparse-keymap boundp electric-indent-chars mapc make-closure #[257 "\301\300\302\303!!\304#\207" [V0 define-key read-kbd-macro char-to-string lua-electric-match] 6 "\n\n(fn ELECTRIC-CHAR)"] define-key [menu-bar lua-mode] "Lua" [remap backward-up-list] lua-backward-up-list vector set-keymap-parent] 6) (#$ . 7554)) #@109 If t, electric actions (like automatic reindentation) will happen when an electric key like `{' is pressed (defvar lua-electric-flag t (#$ . 8160)) (byte-code "\300\301!\210\302\303\304\305\306DD\307\310\311\312\313&\210\302\314\304\305\315DD\316\310\311\312\313&\207" [make-variable-buffer-local lua-electric-flag custom-declare-variable lua-prompt-regexp funcall function #[0 "\300\207" [#1="[^\n]*\\(>[ ]+\\)+$"] 1 #1#] "Regexp which matches the Lua program's prompt." :type regexp :group lua lua-traceback-line-re #[0 "\300\207" [#2="^\\(?:[ ]*\\|.*>[ ]+\\)\\(?:[^\n ]+:[0-9]+:[ ]*\\)*\\(?:\\([^\n ]+\\):\\([0-9]+\\):\\)"] 1 #2#] "Regular expression that describes tracebacks and errors."] 8) #@56 Buffer-local flag saying if this is a Lua REPL buffer. (defvar lua--repl-buffer-p nil (#$ . 8872)) (byte-code "\300\301!\210\302\303\304\305\306$\210\307\303\306\"\210\302\310\311\305\306$\210\307\310\306\"\210\312\313\314\315\316DD\317\320\321\322\323\324\325& \210\312\326\314\315\327DD\330\320\321\322\323\324\325& \210\312\331\314\315\332DD\333\320\321\322\323\324\325& \210\312\334\314\315\335DD\336\322\323\320\321&\210\312\337\314\315\340DD\341\322\342\320\321&\207" [make-variable-buffer-local lua--repl-buffer-p ad-add-advice compilation-find-file (lua--repl-find-file nil t (advice lambda (marker filename directory &rest formats) "Return Lua REPL buffer when looking for \"stdin\" file in it." (if (and lua--repl-buffer-p (string-equal filename "stdin") (not (file-exists-p (expand-file-name filename (when directory (expand-file-name directory)))))) (setq ad-return-value (current-buffer)) ad-do-it))) around nil ad-activate compilation-goto-locus (lua--repl-goto-locus nil t (advice lambda (msg mk end-mk) "When message points to Lua REPL buffer, go to the message itself.\nUsually, stdin:XX line number points to nowhere." (let ((errmsg-buf (marker-buffer msg)) (error-buf (marker-buffer mk))) (if (and (with-current-buffer errmsg-buf lua--repl-buffer-p) (eq error-buf errmsg-buf)) (progn (compilation-set-window (display-buffer (marker-buffer msg)) msg) (goto-char msg)) ad-do-it)))) custom-declare-variable lua-indent-string-contents funcall function #[0 "\300\207" [nil] 1] "If non-nil, contents of multiline string will be indented.\nOtherwise leading amount of whitespace on each line is preserved." :group lua :type boolean :safe booleanp lua-indent-nested-block-content-align #[0 "\300\207" [t] 1] "If non-nil, the contents of nested blocks are indented to\nalign with the column of the opening parenthesis, rather than\njust forward by `lua-indent-level'." lua-indent-close-paren-align #[0 "\300\207" [t] 1] "If non-nil, close parenthesis are aligned with their open\nparenthesis. If nil, close parenthesis are aligned to the\nbeginning of the line." lua-jump-on-traceback #[0 "\300\207" [t] 1] "*Jump to innermost traceback location in *lua* buffer. When this\nvariable is non-nil and a traceback occurs when running Lua code in a\nprocess, jump immediately to the source code of the innermost\ntraceback location." lua-mode-hook #[0 "\300\207" [nil] 1] "Hooks called when Lua mode fires up." hook] 10) #@48 Start of special region for Lua communication. (defvar lua-region-start (make-marker) (#$ . 11308)) #@46 End of special region for Lua communication. (defvar lua-region-end (make-marker) (#$ . 11414)) #@26 Emacs menu for Lua mode. (defvar lua-emacs-menu '(["Restart With Whole File" lua-restart-with-whole-file t] ["Kill Process" lua-kill-process t] ["Hide Process Buffer" lua-hide-process-buffer t] ["Show Process Buffer" lua-show-process-buffer t] ["Beginning Of Proc" lua-beginning-of-proc t] ["End Of Proc" lua-end-of-proc t] ["Set Lua-Region Start" lua-set-lua-region-start t] ["Set Lua-Region End" lua-set-lua-region-end t] ["Send Lua-Region" lua-send-lua-region t] ["Send Current Line" lua-send-current-line t] ["Send Region" lua-send-region t] ["Send Proc" lua-send-proc t] ["Send Buffer" lua-send-buffer t] ["Search Documentation" lua-search-documentation t]) (#$ . 11516)) (defconst lua--builtins (byte-code "\300\301\302\303\304\305\306#\307#\310Q\207" [("_G" "_VERSION" "assert" "collectgarbage" "dofile" "error" "getfenv" "getmetatable" "ipairs" "load" "loadfile" "loadstring" "module" "next" "pairs" "pcall" "print" "rawequal" "rawget" "rawlen" "rawset" "require" "select" "setfenv" "setmetatable" "tonumber" "tostring" "type" "unpack" "xpcall" "self" ("bit32" "arshift" "band" "bnot" "bor" "btest" "bxor" "extract" "lrotate" "lshift" "replace" "rrotate" "rshift") ("coroutine" "create" "isyieldable" "resume" "running" "status" "wrap" "yield") ("debug" "debug" "getfenv" "gethook" "getinfo" "getlocal" "getmetatable" "getregistry" "getupvalue" "getuservalue" "setfenv" "sethook" "setlocal" "setmetatable" "setupvalue" "setuservalue" "traceback" "upvalueid" "upvaluejoin") ("io" "close" "flush" "input" "lines" "open" "output" "popen" "read" "stderr" "stdin" "stdout" "tmpfile" "type" "write") ("math" "abs" "acos" "asin" "atan" "atan2" "ceil" "cos" "cosh" "deg" "exp" "floor" "fmod" "frexp" "huge" "ldexp" "log" "log10" "max" "maxinteger" "min" "mininteger" "modf" "pi" "pow" "rad" "random" "randomseed" "sin" "sinh" "sqrt" "tan" "tanh" "tointeger" "type" "ult") ("os" "clock" "date" "difftime" "execute" "exit" "getenv" "remove" "rename" "setlocale" "time" "tmpname") ("package" "config" "cpath" "loaded" "loaders" "loadlib" "path" "preload" "searchers" "searchpath" "seeall") ("string" "byte" "char" "dump" "find" "format" "gmatch" "gsub" "len" "lower" "match" "pack" "packsize" "rep" "reverse" "sub" "unpack" "upper") ("table" "concat" "insert" "maxn" "move" "pack" "remove" "sort" "unpack") ("utf8" "char" "charpattern" "codepoint" "codes" "len" "offset")) #[257 "\300<\203 @\202\f\301Q\207" ["\\(?1:\\_<" "\\_>\\)"] 4 "\n\n(fn X)"] #[257 "\211<\203 \300\301A!\302Q\207\303\207" ["\\(?:[ ]*\\.[ ]*\\_<\\(?2:" regexp-opt "\\)\\_>\\)?" ""] 4 "\n\n(fn X)"] "\\(?:^\\|[^:. ]\\|[.][.]\\)[ ]*\\(?:" mapconcat make-closure #[257 "\300!\301!P\207" [V0 V1] 4 "\n\n(fn X)"] "\\|" "\\)"] 9)) #@47 Default expressions to highlight in Lua mode. (defvar lua-font-lock-keywords (byte-code "\301\302\303B\304\305B\306\303B\307\310B\311B\312\313B\314\315B\316\317B\320\321B\322\323B\257 \207" [lua--builtins ("^#!.*$" . font-lock-comment-face) "\\_<\\(?:false\\|nil\\|true\\)\\_>" font-lock-constant-face "\\_<\\(?:break\\|do\\|e\\(?:lse\\(?:if\\)?\\|nd\\)\\|f\\(?:or\\|unction\\)\\|goto\\|i[fn]\\|local\\|re\\(?:peat\\|turn\\)\\|then\\|until\\|while\\)\\_>\\|\\_<\\(?:and\\|not\\|or\\)\\_>" font-lock-keyword-face "::[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>[ ]*::" "\\_\\)\\_>" ((1 font-lock-constant-face)) ((1 font-lock-builtin-face) (2 font-lock-builtin-face nil noerror)) "\\_[ ]+\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?3:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?4:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?5:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?6:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?7:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?8:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?9:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\)?\\)?\\)?\\)?\\)?\\)?\\)?\\)?" ((1 font-lock-variable-name-face) (2 font-lock-variable-name-face nil noerror) (3 font-lock-variable-name-face nil noerror) (4 font-lock-variable-name-face nil noerror) (5 font-lock-variable-name-face nil noerror) (6 font-lock-variable-name-face nil noerror) (7 font-lock-variable-name-face nil noerror) (8 font-lock-variable-name-face nil noerror) (9 font-lock-variable-name-face nil noerror)) "\\_\\(?:[ ]+\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)?[ ]*([ ]*\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?3:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?4:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?5:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?6:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?7:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?8:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?9:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\)?\\)?\\)?\\)?\\)?\\)?\\)?\\)?" ((1 font-lock-variable-name-face) (2 font-lock-variable-name-face nil noerror) (3 font-lock-variable-name-face nil noerror) (4 font-lock-variable-name-face nil noerror) (5 font-lock-variable-name-face nil noerror) (6 font-lock-variable-name-face nil noerror) (7 font-lock-variable-name-face nil noerror) (8 font-lock-variable-name-face nil noerror) (9 font-lock-variable-name-face nil noerror)) "\\_[ ]*\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)\\|\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)[ ]*=[ ]*\\_" ((1 font-lock-function-name-face)) "\\_[ ]+\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?3:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?4:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?5:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?6:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?7:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?8:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?9:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\)?\\)?\\)?\\)?\\)?\\)?\\)?\\)?" ((1 font-lock-variable-name-face) (2 font-lock-variable-name-face nil noerror) (3 font-lock-variable-name-face nil noerror) (4 font-lock-variable-name-face nil noerror) (5 font-lock-variable-name-face nil noerror) (6 font-lock-variable-name-face nil noerror) (7 font-lock-variable-name-face nil noerror) (8 font-lock-variable-name-face nil noerror) (9 font-lock-variable-name-face nil noerror)) "\\(?1:@\\_<\\(?:author\\|copyright\\|description\\|field\\|re\\(?:lease\\|turn\\)\\|\\(?:se\\|usag\\)e\\)\\_>\\)\\|\\(?1:@\\_<\\(?:class\\|name\\|param\\)\\_>\\)[ ]+\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)" ((1 font-lock-keyword-face t) (2 font-lock-variable-name-face t noerror))] 12) (#$ . 14232)) #@73 Imenu generic expression for lua-mode. See `imenu-generic-expression'. (defvar lua-imenu-generic-expression (byte-code "\300\301\302BB\303\304\305BBD\207" ["Requires" "\\(?:^\\|;\\)[ ]*\\(?:\\_[ ]*\\)?\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*=[ ]*\\_" (1) nil "\\(?:^\\|;\\)[ ]*\\(?:\\_[ ]*\\)?\\(?:\\_[ ]*\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)\\|\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)[ ]*=[ ]*\\_\\)" (1)] 4) (#$ . 18732)) (defvar lua-sexp-alist '(("then" . "end") ("function" . "end") ("do" . "end") ("repeat" . "until"))) #@46 Abbreviation table used in lua-mode buffers. (defvar lua-mode-abbrev-table nil (#$ . 19567)) (define-abbrev-table 'lua-mode-abbrev-table '(("end" "end" lua-indent-line :system t) ("else" "else" lua-indent-line :system t) ("elseif" "elseif" lua-indent-line :system t))) #@26 `lua-mode' syntax table. (defvar lua-mode-syntax-table (byte-code "\300 p\301\302#\216\303\304 !\210\305\306\307\"\210\305\310\311\"\210\305\312\313\"\210\305\314\313\"\210\305\315\316\"\210\305\317\316\"\210\305\320\316\"\210\305\321\316\"\210\305\322\316\"\210\305\323\316\"\210\305\324\316\"\210\305\325\316\"\210\305\326\316\"\210\300 )\207" [syntax-table make-closure #[0 "r\301q\210\302\300!)\207" [V0 V1 set-syntax-table] 2] set-syntax-table copy-syntax-table modify-syntax-entry 45 ". 12" 10 ">" 39 "\"" 34 43 "." 42 47 94 37 62 60 61 126] 6) (#$ . 19842)) (defvar lua-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [lua-mode-hook variable-documentation put "Hook run after entering Lua mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp lua-mode-map definition-name lua-mode] 4) (defvar lua-mode-map (make-sparse-keymap)) (byte-code "\300\301N\204\302\300\301\303\304!#\210\302\305\306\307#\210\302\305\310\311#\207" [lua-mode-map variable-documentation put purecopy "Keymap for `lua-mode'." lua-mode derived-mode-parent prog-mode custom-mode-group lua] 5) #@218 Major mode for editing Lua code. In addition to any hooks its parent mode `prog-mode' might have run, this mode runs the hook `lua-mode-hook', as the final or penultimate step during initialization. \{lua-mode-map} (defalias 'lua-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320 !\210\321\f!\210 <\306\322!\210\323\306\324!\210\325\306\326!\210\307\306\327!\210\330\306\331!\210\332\306\333!\210\334\306\335!\210=\306\336!\210>\306\337!\210\307\306\340!\210\341 \306\342!\210\307\"\306\343!\210?#\344\345!\203\233\306\345!\210\346%@\"%\347\350!\203\311\344\351!\203\311\352\353!\203\311\352\354!\203\311\355\312)\"\204\311\353\356)!!\210\354\357\312A#\210\344\360!\203\327\n\361PAB0\3113\236\204\367\362\363\311\364\365\366B\"\367\"\364\365\370B\"\367\"\371BBB\"\210)\372\373!\207" [delay-mode-hooks major-mode mode-name lua-mode-map lua-mode-syntax-table lua-mode-abbrev-table make-local-variable t prog-mode lua-mode "Lua" mode-class put keymap-parent set-keymap-parent current-local-map use-local-map set-syntax-table font-lock-defaults (lua-font-lock-keywords nil nil nil nil) syntax-propertize-function lua--propertize-multiline-bounds parse-sexp-lookup-properties indent-line-function lua-indent-line beginning-of-defun-function lua-beginning-of-proc end-of-defun-function lua-end-of-proc comment-start comment-start-skip comment-use-syntax fill-paragraph-function lua--fill-paragraph comment-use-global-state imenu-generic-expression boundp electric-indent-chars append featurep menubar current-menubar fboundp set-buffer-menubar add-menu assoc copy-sequence nil mode-popup-menu " Mode Commands" add-to-list hs-special-modes-alist regexp-opt mapcar car words cdr (nil lua-forward-sexp) run-mode-hooks lua-mode-hook local-abbrev-table lua-comment-start lua-comment-start-skip lua-imenu-generic-expression lua--electric-indent-chars lua-emacs-menu lua-sexp-alist] 8 (#$ . 21072) nil]) (byte-code "\300\301\302\"\210\300\303\304\"\207" [add-to-list auto-mode-alist ("\\.lua\\'" . lua-mode) interpreter-mode-alist ("lua" . lua-mode)] 3) #@52 Insert character and adjust indentation. (fn ARG) (defalias 'lua-electric-match #[257 "\302\303\304!!\210) \203\305 \210\306 \207" [blink-paren-function lua-electric-flag nil self-insert-command prefix-numeric-value lua-indent-line blink-matching-open] 4 (#$ . 23236) "P"]) #@33 (fn &optional JUSTIFY REGION) (defalias 'lua--fill-paragraph #[512 "\212m\204\302 \210\303!\203\304y\210\202\305\306\"*\207" [paragraph-separate fill-paragraph-handle-comment move-to-left-margin looking-at 1 t fill-paragraph] 5 (#$ . 23521)]) (defalias 'lua-prefix-key-update-bindings #[0 "\303\304 !=\203\305 \303\"\210\202 \306 \"\211\262\203 \307 \"\210\n\204)\305 \"\207\310 \311\n!#\207" [lua-prefix-mode-map lua-mode-map lua-prefix-key nil keymap-parent set-keymap-parent rassoc delq define-key vector] 5]) #@141 Changes `lua-prefix-key' properly and updates keymaps This function replaces previous prefix-key binding with a new one. (fn NEW-KEY-STR) (defalias 'lua-set-prefix-key #[257 "\301\300\"\210\302\303\304!\"\210\305 \207" [lua-prefix-key lua--customize-set-prefix-key message "Prefix key set to %S" single-key-description lua-prefix-key-update-bindings] 5 (#$ . 24064) "sNew prefix key (empty string means no key): "]) #@63 Returns true if the point is in a string. (fn &optional POS) (defalias 'lua-string-p #[256 "\212\300!\301\234)\207" [syntax-ppss 3] 3 (#$ . 24490)]) #@121 Return position of comment containing current point. If point is not inside a comment, return nil. (fn PARSING-STATE) (defalias 'lua-comment-start-pos #[257 "\211\205 \3008\205 \3018\207" [4 8] 3 (#$ . 24648)]) #@74 Returns true if the point is in a comment or string. (fn &optional POS) (defalias 'lua-comment-or-string-p #[256 "\212\300!\211\301\234\206 \211\302\234\262)\207" [syntax-ppss 3 4] 4 (#$ . 24871)]) #@142 Returns start position of string or comment which contains point. If point is not inside string or comment, return nil. (fn &optional POS) (defalias 'lua-comment-or-string-start-pos #[256 "\212\300!\301\234)\207" [syntax-ppss 8] 3 (#$ . 25080)]) (defconst lua-ml-begin-regexp "\\(?:\\(?1:-\\)-\\[\\|\\(?2:\\[\\)\\)\\(?3:=*\\)\\[") #@189 Try to match close-bracket for multiline literal around point. Basically, detect form of close bracket from syntactic information provided at point and re-search-forward to it. (fn END) (defalias 'lua-try-match-multiline-end #[257 "\301 \211\205%\212\211b\210\302!)\205%\303\304\305\306\307!\310\224\203 \310\202!\311#\312#\207" [lua-ml-begin-regexp lua-comment-or-string-start-pos looking-at re-search-forward format "]%s\\(?%s:]\\)" match-string-no-properties 3 1 2 noerror] 7 (#$ . 25421)]) #@170 Try to match multiline open-brackets. Find next opening long bracket outside of any string/comment. If none can be found before reaching LIMIT, return nil. (fn LIMIT) (defalias 'lua-try-match-multiline-begin #[257 "\301\302\303#\211\262\203(\304\305\224!\204\305\224f\306=\203(\305\224\206!`Sf\306=\204\207" [lua-ml-begin-regexp nil re-search-forward noerror lua-comment-or-string-start-pos 0 45] 6 (#$ . 25930)]) #@14 (fn LIMIT) (defalias 'lua-match-multiline-literal-bounds #[257 "\300!\206 \301!\207" [lua-try-match-multiline-end lua-try-match-multiline-begin] 3 (#$ . 26362)]) #@139 Put text properties on beginnings and ends of multiline literals. Intended to be used as a `syntax-propertize-function'. (fn START END) (defalias 'lua--propertize-multiline-bounds #[514 "\212b\210\300!\205)\301\224\203\302\301\224\301\225\303\304$\210\305\224\203\302\305\224\305\225\303\306$\210\202)\207" [lua-match-multiline-literal-bounds 1 put-text-property syntax-table (14) 2 (15)] 7 (#$ . 26536)]) #@81 Indent current line for Lua mode. Return the amount the indentation changed by. (defalias 'lua-indent-line #[0 "\301\211d`Z\302 \210\303 \203\304 \262\202\305\306 ]\262i\232\204*\307 `|\210j\210dZ`V\2037dZb\210)\207" [case-fold-search nil back-to-indentation lua-comment-or-string-p lua-calculate-string-or-comment-indentation 0 lua-calculate-indentation line-beginning-position] 5 (#$ . 26959)]) #@82 This function should be run when point at (current-indentation) is inside string (defalias 'lua-calculate-string-or-comment-indentation #[0 "\302 \203\f\204\f\303 \207\304\305!\212\306 b\210\303 \203)\304\307\310\311\312!\"!\203)\313\202* \\)\207" [lua-indent-string-contents lua-indent-level lua-string-p current-indentation looking-at "\\s *\\(?:--\\)?\\]\\(?1:=*\\)\\]" lua-comment-or-string-start-pos format "--\\[%s\\[" match-string-no-properties 1 0] 7 (#$ . 27377)]) #@433 Searches for a regular expression in the direction specified. Direction is one of 'forward and 'backward. By default, matches in comments and strings are ignored, but what to ignore is configurable by specifying ignore-p. If the regexp is found, returns point position, nil otherwise. ignore-p returns true if the match at the current point position should be ignored, nil otherwise. (fn DIRECTION REGEXP &optional LIMIT IGNORE-P) (defalias 'lua-find-regexp #[1026 "\211\206\301\302=\203\303\202\304\305\30625\211\307#\2054\310\224!\204\310\225!\204\311\306`\"\210\2020)\207" [case-fold-search lua-comment-or-string-p forward re-search-forward re-search-backward nil found t 0 throw] 10 (#$ . 27865)]) (defconst lua-block-regexp "\\(\\_<\\(do\\|e\\(?:lse\\(?:if\\)?\\|nd\\)\\|function\\|repeat\\|then\\|until\\)\\_>\\)\\|\\([]()[{}]\\)") #@639 This is a list of block token information blocks. Each token information entry is of the form: KEYWORD FORWARD-MATCH-REGEXP BACKWARDS-MATCH-REGEXP TOKEN-TYPE KEYWORD is the token. FORWARD-MATCH-REGEXP is a regexp that matches all possible tokens when going forward. BACKWARDS-MATCH-REGEXP is a regexp that matches all possible tokens when going backwards. TOKEN-TYPE determines where the token occurs on a statement. open indicates that the token appears at start, close indicates that it appears at end, middle indicates that it is a middle type token, and middle-or-open indicates that it can appear both as a middle or an open type. (defconst lua-block-token-alist '(("do" "\\_" "\\_" middle-or-open) ("function" "\\_" nil open) ("repeat" "\\_" nil open) ("then" "\\_<\\(e\\(lse\\(if\\)?\\|nd\\)\\)\\_>" "\\_<\\(else\\)?if\\_>" middle) ("{" "}" nil open) ("[" "]" nil open) ("(" ")" nil open) ("if" "\\_" nil open) ("for" "\\_" nil open) ("while" "\\_" nil open) ("else" "\\_" "\\_" middle) ("elseif" "\\_" "\\_" middle) ("end" nil "\\_<\\(do\\|function\\|then\\|else\\)\\_>" close) ("until" nil "\\_" close) ("}" nil "{" close) ("]" nil "\\[" close) (")" nil "(" close)) (#$ . 28731)) (defconst lua-indentation-modifier-regexp "\\(\\_<\\(do\\|else\\(?:if\\)?\\|f\\(?:or\\|unction\\)\\|if\\|repeat\\|then\\|while\\)\\_>\\|[([{]\\)\\|\\(\\_<\\(end\\|until\\)\\_>\\|[])}]\\)") #@85 Returns the block token info entry for TOKEN from lua-block-token-alist (fn TOKEN) (defalias 'lua-get-block-token-info #[257 "\301\"\207" [lua-block-token-alist assoc] 4 (#$ . 30228)]) #@78 Returns the relevant match regexp from token info (fn TOKEN-INFO DIRECTION) (defalias 'lua-get-token-match-re #[514 "\211\300\267\202A@\207\3018\207\302\207" [#s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (forward 6 backward 10)) 2 nil] 4 (#$ . 30422)]) #@68 Returns the relevant match regexp from token info (fn TOKEN-INFO) (defalias 'lua-get-token-type #[257 "\3008\207" [3] 3 (#$ . 30726)]) #@79 Move backwards to nearest block begin or end. Returns nil if not successful. (defalias 'lua-backwards-to-block-begin-or-end #[0 "\301\302\"\207" [lua-block-regexp lua-find-regexp backward] 3 (#$ . 30869) nil]) #@409 Find matching open- or close-token for TOKEN in DIRECTION. Point has to be exactly at the beginning of TOKEN, e.g. with | being point {{ }|} -- (lua-find-matching-token-word "}" 'backward) will return -- the first { {{ |}} -- (lua-find-matching-token-word "}" 'backward) will find -- the second {. DIRECTION has to be either 'forward or 'backward. (fn TOKEN &optional DIRECTION) (defalias 'lua-find-matching-token-word #[513 "\301!\302!\206\211\303=\204\211\304=\203\305\202\306\307\"\310\305=\203)\311u\210\3122\335\305=\2039\313=\204E\306=\203J\303=\203J\314\312\310\"\210\315\"\203\333\316\317!\317\224\302\301!!\203f\320\"\204\245\321=\204\207\211\321=\204\207\304=\204\207\211\304=\204\207=\203\224b\203\224\322\"\204\326\203\240b\210\314\312\"\210\266\202J\211\321=\204\266\211\304=\204\266\314\312\"\210\211\304=\203\277\262\262\n\301\n!\262\307\"\262\302!\262\266\202J\2110\207" [lua-indentation-modifier-regexp lua-get-block-token-info lua-get-token-type open middle-or-open forward backward lua-get-token-match-re nil 1 found close throw lua-find-regexp match-string 0 string-match middle lua-find-matching-token-word] 13 (#$ . 31088)]) #@430 Find block begion/end token matching the one at the point. This function moves the point to the token that matches the one at the current point. Returns the point position of the first character of the matching token if successful, nil otherwise. Optional PARSE-START is a position to which the point should be moved first. DIRECTION has to be 'forward or 'backward ('forward by default). (fn &optional PARSE-START DIRECTION) (defalias 'lua-goto-matching-block-token #[512 "\203b\210\302\303 !\205\304\305\306!\"\211\205\211b\262)\207" [case-fold-search lua-indentation-modifier-regexp nil looking-at lua-find-matching-token-word match-string 0] 5 (#$ . 32347)]) #@294 Go to the keyword balancing the one under the point. If the point is on a keyword/brace that starts a block, go to the matching keyword that ends the block, and vice versa. If optional NOREPORT is non-nil, it won't flag an error if there is no block open/close open. (fn &optional NOREPORT) (defalias 'lua-goto-matching-block #[256 "gz\300=\203 \301\302\303\304#\210\305 \211\204\204\306\307!\207\207" [119 re-search-backward "\\_<" nil t lua-goto-matching-block-token error "Not on a block control keyword or brace"] 5 (#$ . 33031) nil]) #@307 Move 1 line forward (back if BACK is non-nil) skipping blank lines. Moves point 1 line forward (or backward) skipping lines that contain no Lua code besides comments. The point is put to the beginning of the line. Returns final value of point as integer or nil if operation failed. (fn &optional BACK) (defalias 'lua-forward-line-skip-blanks #[256 "\3002+\211\203\f\301\202 \302y\303=\204\304\300\305\"\210\306\307!\204\310 \204\304\300`\"\210\202\207" [found -1 1 0 throw nil looking-at "\\s *\\(--.*\\)?$" lua-comment-or-string-p] 4 (#$ . 33585)]) #@265 Regexp that matches the ending of a line that needs continuation. This regexp starts from eol and looks for a binary operator or an unclosed block intro (i.e. 'for' without 'do' or 'if' without 'then') followed by an optional whitespace till the end of the line. (defconst lua-cont-eol-regexp "\\(?:\\(?1:\\_<\\(and\\|elseif\\|f\\(?:or\\|unction\\)\\|i[fn]\\|local\\|not\\|or\\|return\\|until\\|while\\)\\_>\\)\\|\\(?:^\\|[^-+*/^.=<>~:&|]\\)\\(?2:\\(\\.\\.\\|<[<=]\\|==\\|>[=>]\\|~=\\|[%&*+,./:<=>|~^-]\\)\\)\\)\\s *\\=" (#$ . 34157)) #@355 Regexp that matches a line that continues previous one. This regexp means, starting from point there is an optional whitespace followed by Lua binary operator. Lua is very liberal when it comes to continuation line, so we're safe to assume that every line that starts with a binop continues previous one even though it looked like an end-of-statement. (defconst lua-cont-bol-regexp "\\=\\s *\\(?:\\(?1:\\_<\\(and\\|not\\|or\\)\\_>\\)\\|\\(?2:\\(\\.\\.\\|<[<=]\\|==\\|>[=>]\\|~=\\|[%&*+,./:<=>|~^-]\\)\\)\\(?:$\\|[^-+*/^.=<>~:&|]\\)\\)" (#$ . 34700)) #@72 Return non-nil if the last token on this line is a continuation token. (defalias 'lua-last-token-continues-p #[0 "\301 \302 \303\212\303\210\304\305\306\307$\203\310\311!\203 `\262\202 b\210\312\313#\2050\314\224\2060\315\224\262\211\203]\316\317!\320\230\203]\212\317\225b\210\321d!\210m?\205V\310\322!\206V\310\323!?)\204]\303\262)\207" [lua-cont-eol-regexp line-beginning-position line-end-position nil lua-find-regexp backward "-" lua-string-p looking-at "--" re-search-backward t 1 2 match-string-no-properties 0 "return" forward-comment "\\_" ";\\|\\_<\\(?:break\\|do\\|e\\(?:lse\\(?:if\\)?\\|nd\\)\\|f\\(?:or\\|unction\\)\\|goto\\|i[fn]\\|local\\|re\\(?:peat\\|turn\\)\\|then\\|until\\|while\\)\\_>"] 8 (#$ . 35258)]) #@73 Return non-nil if the first token on this line is a continuation token. (defalias 'lua-first-token-continues-p #[0 "\301 \212\302 \210\303\304#\205\305\224\206\306\224)\207" [lua-cont-bol-regexp line-end-position beginning-of-line re-search-forward t 1 2] 5 (#$ . 36021)]) #@69 Safe version of lua-backward-up-list that does not signal an error. (defalias 'lua--backward-up-list-noerror #[0 "\3001\301 0\207\210\302\207" [(scan-error) lua-backward-up-list nil] 1 (#$ . 36306)]) #@55 Goto starter/opener of the block that contains point. (defalias 'lua-backward-up-list #[0 "`\301\211\211\211\302\301\303\304\"\211\262\203>\305\306!\262\307!\262\310!\262\311=\203>\312\304\"\211\2050\211b\262\211\262\203>\301\262\202\205C\266\205\206o`\262b\210\313\314\315\316\"\203\\\202^\306\224\316\"\203k\202m\306\225E\"\207" [lua-indentation-modifier-regexp nil t lua-find-regexp backward match-string-no-properties 0 lua-get-block-token-info lua-get-token-type close lua-find-matching-token-word signal scan-error "Block open token not found" eql] 10 (#$ . 36514) nil]) #@355 Return non-nil if current lined continues a statement. More specifically, return the point in the line that is continued. The criteria for a continuing statement are: * the last token of the previous line is a continuing op, OR the first token of the current line is a continuing op * the expression is not enclosed by a parentheses/braces/brackets (defalias 'lua-is-continuing-statement-p-1 #[0 "\300\211\211\212\301\302!\262)\205N\212\303 \206\212b\205\304 )\211\262\205A\305 \242\211\262\205<\211\306\235\206<f\307=\205<\211\310\232?\205A)\206N\305 \242\311\230\205N`\207" [nil lua-forward-line-skip-blanks back lua-first-token-continues-p lua-last-token-continues-p lua--backward-up-list-noerror ("(" "[") 44 "{" "for"] 5 (#$ . 37134)]) #@271 Returns non-nil if the line at PARSE-START should be indented as continuation line. This true is when the line : * is continuing a statement itself * starts with a 1+ block-closer tokens, an top-most block opener is on a continuation line (fn &optional PARSE-START) (defalias 'lua-is-continuing-statement-p #[256 "\212\211\203\211b\210\300 \203\301 \203\302 \204\302 )\207" [lua--goto-line-beginning-rightmost-closer lua--backward-up-list-noerror lua-is-continuing-statement-p-1] 2 (#$ . 37906)]) #@187 Create a pair from FOUND-TOKEN and FOUND-POS for indentation calculation. This is a helper function to lua-calculate-indentation-info. Don't use standalone. (fn FOUND-TOKEN FOUND-POS) (defalias 'lua-make-indentation-info-pair #[514 "\303\230\203\n\304B\207 \203;\305\306\307E\235\203;\212\310 \311d!\210\312\310 \"\313U\2034\314\n!\2044\315iB\2027\304B\262)\207\316\317\320E\235\203H\304\313B\207\321\322D\235\203p\212\310 \323\324\"\205]\211`X\211\203i\325\313B\266\202\202n\304\313B\266\202)\207\326\230\203\230\212\310 \323\324\"\205\203\211`X\211\203\221\327\304BB\266\202\202\226\304B\266\202)\207\330\331\332\333F\235\203\302\212\310 \323\324\"\205\257\211`X\211\204\273\334`!\266\202\202\300\325\313B\266\202)\207\335\235\203\317\336\337\304BE\207\304\340\341 8\203\333\202\335[B\207" [lua-indent-level lua-indent-nested-block-content-align lua-indentation-modifier-regexp "function" relative "{" "(" "[" line-beginning-position forward-comment count-lines 0 looking-at absolute "if" "for" "while" "until" "elseif" lua-goto-matching-block-token backward remove-matching "else" replace-matching ")" "}" "]" "end" lua-calculate-indentation-info ("do" "then") multiple (cancel-continued-line) 2 match-data] 7 (#$ . 38422)]) #@752 Add the given indentation info PAIR to the list of indentation INFO-LIST. This function has special case handling for two tokens: remove-matching, and replace-matching. These two tokens are cleanup tokens that remove or alter the effect of a previously recorded indentation info. When a remove-matching token is encountered, the last recorded info, i.e. the car of the list is removed. This is used to roll-back an indentation of a block opening statement when it is closed. When a replace-matching token is seen, the last recorded info is removed, and the cdr of the replace-matching info is added in its place. This is used when a middle-of the block (the only case is 'else') is seen on the same line the block is opened. (fn PAIR INFO-LIST) (defalias 'lua-add-indentation-info-pair #[514 "@\300=\203A\211\203\301@\"\262\211A\262\202 \207@\302=\2030\211@@\303=\203/\211A\207\207@\304=\203:\211A\207@\305=\203GAAB\207\243<\203Q\244\207B\207" [multiple lua-add-indentation-info-pair cancel-continued-line continued-line remove-matching replace-matching] 6 (#$ . 39700)]) #@143 Helper function for `lua-calculate-indentation-info'. Return list of indentation modifiers from point to BOUND. (fn INDENTATION-INFO BOUND) (defalias 'lua-calculate-indentation-info-1 #[514 "\301\302#\203\303\304!\304\224\305\306\"\"\262\266\202\207" [lua-indentation-modifier-regexp lua-find-regexp forward match-string 0 lua-add-indentation-info-pair lua-make-indentation-info-pair] 8 (#$ . 40812)]) #@375 For each block token on the line, computes how it affects the indentation. The effect of each token can be either a shift relative to the current indentation level, or indentation to some absolute column. This information is collected in a list of indentation info pairs, which denote absolute and relative each, and the shift/column to indent to. (fn &optional PARSE-END) (defalias 'lua-calculate-indentation-info #[256 "\301\211\302 \211\262\203\303\304!\210\211`W\203\211b\210\202\305\306 BC\262\307 \210\310\311 ^\"\262\312y\313=\203m`X\203m\302 \203Q@@\314=\204a\314BB\262\202a@@\314=\203a\315[BB\262\310\311 ^\"\262\202-\207" [lua-indent-level nil lua-is-continuing-statement-p lua-forward-line-skip-blanks back absolute current-indentation back-to-indentation lua-calculate-indentation-info-1 line-end-position 1 0 continued-line stop-continued-line] 7 (#$ . 41235)]) #@214 Accumulates the indentation information previously calculated by lua-calculate-indentation-info. Returns either the relative indentation shift, or the absolute column to indent to. (fn REVERSED-INDENTATION-INFO) (defalias 'lua-accumulate-indentation-info #[257 "\300\301C\302C\211\2034\211@\211@\301=\203(@@\301=\203(@@AA\\\241\210\202-\211B\262A\266\202\202\210\303\304\305#\"\210\242\242B\207" [nil relative 0 mapc make-closure #[257 "\211A@\302=\203\300\302\240\210\301\240\207\301\211\242\\\240\207" [V0 V1 absolute] 5 "\n\n(fn X)"]] 9 (#$ . 42149)]) #@296 Return amount by which this line modifies the indentation. Beginnings of blocks add lua-indent-level once each, and endings of blocks subtract lua-indent-level once each. This function is used to determine how the indentation of the following line relates to this one. (fn &optional PARSE-END) (defalias 'lua-calculate-indentation-block-modifier #[256 "\301\212\301\302\303!!\262*\211@\304=\203\211A\305 Z\207\211A\207" [case-fold-search nil lua-accumulate-indentation-info lua-calculate-indentation-info absolute current-indentation] 5 (#$ . 42736)]) #@909 Regular expression that matches left-shifter expression. Left-shifter expression is defined as follows. If a block follows a left-shifter expression, its contents & block-close token should be indented relative to left-shifter expression indentation rather then to block-open token. For example: -- 'local a = ' is a left-shifter expression -- 'function' is a block-open token local a = function() -- block contents is indented relative to left-shifter foobarbaz() -- block-end token is unindented to left-shifter indentation end The following left-shifter expressions are currently handled: 1. local function definition with function block, begin-end 2. function call with arguments block, () or {} 3. assignment/return statement with - table constructor block, {} - function call arguments block, () or {} block - function expression a.k.a. lambda, begin-end block. (defconst lua--left-shifter-regexp "\\(?1:\\_\\|\\(?1:\\_<[_[:alnum:]]+\\(?:\\.[_[:alnum:]]+\\)*\\(?::[_[:alnum:]]+\\)?\\_>[[:blank:]]*\\)[({]\\|\\(?1:.*[^<->~]=[[:blank:]]*\\|\\[[:blank:]]*\\)\\(?:{\\|function\\|(\\|\\(?1:\\_<[_[:alnum:]]+\\(?:\\.[_[:alnum:]]+\\)*\\(?::[_[:alnum:]]+\\)?\\_>[[:blank:]]*\\)[({]\\)" (#$ . 43301)) #@145 Check if point is right after a left-shifter expression. See `lua--left-shifter-regexp' for description & example of left-shifter expression.  (defalias 'lua-point-is-after-left-shifter-p #[0 "\212`\301 \210`U?\205\302!\205\211\303\225U\262)\207" [lua--left-shifter-regexp back-to-indentation looking-at 1] 3 (#$ . 44589)]) #@30 (fn &optional PARSE-START) (defalias 'lua--goto-line-beginning-rightmost-closer #[256 "\302\211\211\211\212\203b\210\303 \262\304 \210\305 \204S\302\211\211`X\203Q\306 !\203Q\307\310\311!!\262\312!\262\313=\204Q\311\224\262\262\311\225b\210\314\303 !\210\302\262\202\266)\205\\b\210\211)\207" [case-fold-search lua-indentation-modifier-regexp nil line-end-position back-to-indentation lua-comment-or-string-p looking-at lua-get-block-token-info match-string 0 lua-get-token-type open forward-comment] 11 (#$ . 44927)]) #@310 Return overriding indentation amount for special cases. If there's a sequence of block-close tokens starting at the beginning of the line, calculate indentation according to the line containing block-open token for the last block-close token in the sequence. If not, return nil. (fn &optional PARSE-START) (defalias 'lua-calculate-indentation-override #[256 "\302\211\211\211\212\303!\211\262\205]\304 \211\262\205]\305\306\307\"@\"\205]`\262@\310\230\2035\304 @\311\235\204G@\312\230\203D\304 @\313\235\204G\211b\210 \203[@\314\235\203[\315 \204[i\202]\316 *\207" [case-fold-search lua-indent-close-paren-align nil lua--goto-line-beginning-rightmost-closer lua--backward-up-list-noerror string-match lua-get-token-match-re backward "do" ("while" "for") "then" ("if" "elseif") ("{" "(" "[") lua-point-is-after-left-shifter-p current-indentation] 9 (#$ . 45481)]) #@62 Return appropriate indentation for current line as Lua code. (defalias 'lua-calculate-indentation #[0 "\212\300 \301 \206\302\303!\203\304!\305 \\\262\206\306\262)\207" [line-beginning-position lua-calculate-indentation-override lua-forward-line-skip-blanks back lua-calculate-indentation-block-modifier current-indentation 0] 4 (#$ . 46375)]) #@78 Lua top level (matches only at the beginning of line) function header regex. (defvar lua--beginning-of-defun-re (lua-rx-to-string '(: bol (32 (symbol "local") ws+) lua-funcheader)) (#$ . 46735)) #@257 Move backward to the beginning of a Lua proc (or similar). With argument, do it that many times. Negative arg -N means move forward to Nth following beginning of proc. Returns t unless search stops due to beginning or end of buffer. (fn &optional ARG) (defalias 'lua-beginning-of-proc #[256 "\211\204\301\262\211\302V\203\303\304\305#\203\211S\262\202\211\302W\2034\306\304\305#\2034\307 \210\211T\262\202\211\302U\207" [lua--beginning-of-defun-re 1 0 re-search-backward nil t re-search-forward beginning-of-line] 5 (#$ . 46937) "P"]) #@247 Move forward to next end of Lua proc (or similar). With argument, do it that many times. Negative argument -N means move back to Nth preceding end of proc. This function just searches for a `end' at the beginning of a line. (fn &optional ARG) (defalias 'lua-end-of-proc #[256 "\211\204\300\262\301\302\303W\203!n\204!\212\304 \210g)\305=\203!\306u\210\303V\203B\307\310\301\302#\2039S\262\302\262\202!\301\262\303\262\202!\303W\203c\311\310\301\302#\203ZT\262\302\262\202B\301\262\303\262\202B\203m\304 \210\301y\210\207" [1 nil t 0 beginning-of-line 125 -1 re-search-forward "^end" re-search-backward] 7 (#$ . 47500) "P"]) (defvar lua-process-init-code (mapconcat 'identity '("local loadstring = loadstring or load" "function luamode_loadstring(str, displayname, lineoffset)" " if lineoffset > 1 then" " str = string.rep('\\n', lineoffset - 1) .. str" " end" "" " local x, e = loadstring(str, '@'..displayname)" " if e then" " error(e)" " end" " return x()" "end") " ")) #@42 Convert string to Lua literal. (fn STR) (defalias 'lua-make-lua-string #[257 "\300 \301\302\"\216\303\304\305\"r\211q\210\301\306\"\216c\210eb\210\307\310\311\305#\203H\312\313!\314\230\2031\315\316!\210\202\312\313!\317\230\203@\315\320!\210\202\315\321\305\"\210\202\322\323 \322Q*\262)\207" [match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] generate-new-buffer " *temp*" t #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] re-search-forward "[\"'\\ \\\n]" nil match-string 0 "\n" replace-match "\\\\n" " " "\\\\t" "\\\\\\&" "'" buffer-string] 7 (#$ . 48522)]) (defalias 'run-lua 'lua-start-process) #@232 Start a Lua process named NAME, running PROGRAM. PROGRAM defaults to NAME, which defaults to `lua-default-application'. When called interactively, switch to the process buffer. (fn &optional NAME PROGRAM STARTFILE &rest SWITCHES) (defalias 'lua-start-process #[896 "\211\204\262\206 :\203 @\202 \262\206 \262\306\307%\310\n!\311 \312\"\210r\nq\210\313\314!\210\315\316\317!\210 \320\321EB\322\320!\210\316\323!\210\324 \204d\325\310p!!\210db\210\202S\326!\210)\327\330!\205s\331\n!\207" [lua-default-command-switches lua-default-application lua-process-buffer lua-process lua--repl-buffer-p lua-traceback-line-re apply make-comint get-buffer-process set-process-query-on-exit-flag nil require compile t make-local-variable compilation-error-regexp-alist 1 2 compilation-shell-minor-mode comint-prompt-regexp lua-prompt-line accept-process-output lua-send-string called-interactively-p any switch-to-buffer lua-prompt-regexp lua-process-init-code] 10 (#$ . 49195) nil]) #@54 Return active Lua process creating one if necessary. (defalias 'lua-get-create-process #[0 "\302!\204 \303 \210 \207" [lua-process-buffer lua-process comint-check-proc lua-start-process] 2 (#$ . 50207)]) #@34 Kill Lua process and its buffer. (defalias 'lua-kill-process #[0 "\301!\205 \302!\210\303\211\207" [lua-process-buffer buffer-live-p kill-buffer nil] 2 (#$ . 50419) nil]) #@77 Set start of region for use with `lua-send-lua-region'. (fn &optional ARG) (defalias 'lua-set-lua-region-start #[256 "\206`\301\223\207" [lua-region-start nil] 4 (#$ . 50600) nil]) #@75 Set end of region for use with `lua-send-lua-region'. (fn &optional ARG) (defalias 'lua-set-lua-region-end #[256 "\206`\301\223\207" [lua-region-end nil] 4 (#$ . 50792) nil]) #@116 Send STR plus a newline to the Lua process. If `lua-process' is nil or dead, start a new process first. (fn STR) (defalias 'lua-send-string #[257 "\211\300\301O\302\230\204\211\302P\262\303\304 \"\207" [-1 nil "\n" process-send-string lua-get-create-process] 4 (#$ . 50979)]) #@123 Send current line to the Lua process, found in `lua-process'. If `lua-process' is nil or dead, start a new process first. (defalias 'lua-send-current-line #[0 "\300\301 \302 \"\207" [lua-send-region line-beginning-position line-end-position] 3 (#$ . 51268) nil]) #@73 Send the function definition around point to the Lua process. (fn POS) (defalias 'lua-send-defun #[257 "\212\300 \301\302\"\216\303\304!)\262\203`\202\305 \210`\306 \210`Y\2032W\2032\307\"\266\202\2027\310\311!\266\202)\207" [match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] looking-at "^function[ ]" lua-beginning-of-proc lua-end-of-proc lua-send-region error "Not on a function definition"] 6 (#$ . 51537) "d"]) #@232 Skip shebang (#!/path/to/interpreter/) line at beginning of buffer. Return a position that is after Lua-recognized shebang line (1st character in file must be ?#) if START is at its beginning. Otherwise, return START. (fn START) (defalias 'lua-maybe-skip-shebang-line #[257 "\214~\210\211e=\203\211f\300=\203\212\211b\210\301y\210`)\202\211)\207" [35 nil] 3 (#$ . 52008)]) #@18 (fn START END) (defalias 'lua-send-region #[514 "\301!\262\302!\303 \206\304 \305\"\306\307\310!\310!$\311!\210\205(\312 \207" [lua-always-show lua-maybe-skip-shebang-line line-number-at-pos buffer-file-name buffer-name buffer-substring-no-properties format "print(''); luamode_loadstring(%s, %s, %s);\n" lua-make-lua-string lua-send-string lua-show-process-buffer] 10 (#$ . 52395) "r"]) (defalias 'lua-prompt-line #[0 "\212\301 \302\303\"\216\304y\210\305!\205\304\225)\262)\207" [comint-prompt-regexp match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] 0 looking-at] 4]) #@40 Send preset Lua region to Lua process. (defalias 'lua-send-lua-region #[0 "\203 \204\f\302\303!\210\304 \"\207" [lua-region-start lua-region-end error "lua-region not set" lua-send-region] 3 (#$ . 53025) nil]) (defalias 'lua-send-proc 'lua-send-defun) #@35 Send whole buffer to Lua process. (defalias 'lua-send-buffer #[0 "\300ed\"\207" [lua-send-region] 3 (#$ . 53288) nil]) #@51 Restart Lua process and send whole file as input. (defalias 'lua-restart-with-whole-file #[0 "\300 \210\301 \207" [lua-kill-process lua-send-buffer] 1 (#$ . 53413) nil]) #@103 Make sure `lua-process-buffer' is being displayed. Create a Lua process if one doesn't already exist. (defalias 'lua-show-process-buffer #[0 "\300\301\302 !!\207" [display-buffer process-buffer lua-get-create-process] 3 (#$ . 53590) nil]) #@55 Delete all windows that display `lua-process-buffer'. (defalias 'lua-hide-process-buffer #[0 "\301!\205 \302!\207" [lua-process-buffer buffer-live-p delete-windows-on] 2 (#$ . 53835) nil]) #@41 Get current Name { '.' Name } sequence. (defalias 'lua-funcname-at-point #[0 "\300 p\301\302#\216\303\304 !\210\305\306\307\"\210\310\311!)\207" [syntax-table make-closure #[0 "r\301q\210\302\300!)\207" [V0 V1 set-syntax-table] 2] set-syntax-table copy-syntax-table modify-syntax-entry 46 "_" current-word t] 6 (#$ . 54033)]) #@53 Search Lua documentation for the word at the point. (defalias 'lua-search-documentation #[0 "\302\303 Q !\207" [lua-documentation-url lua-documentation-function "#pdf-" lua-funcname-at-point] 3 (#$ . 54367) nil]) #@213 Toggle the electric indentation feature. Optional numeric ARG, if supplied, turns on electric indentation when positive, turns it off when negative, and just toggles it when zero or left out. (fn &optional ARG) (defalias 'lua-toggle-electric-state #[256 "\301!\203 \211\302U\203?\202#\211\302W\203\303\202#\211\302V\205#\304\210\305\306\"\207" [lua-electric-flag prefix-numeric-value 0 nil t message "%S"] 4 (#$ . 54589) "P"]) #@44 Forward to block end (fn &optional COUNT) (defalias 'lua-forward-sexp #[256 "\301 \302\303\"\216\206\f\304\305\306\"\307V\205:\310\311w\210\312\313\314\"!\203/\315\304!\316\317\"\266\2023\320\304!\210S\262\202\266\202)\207" [lua-sexp-alist match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] 1 mapcar car 0 " \n" nil looking-at regexp-opt words match-string lua-find-matching-token-word forward forward-sexp] 8 (#$ . 55036) "p"]) (byte-code "\301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\311#\210\301\312\313#\210\301\314\315#\210\301\316\317#\210\301\320\321#\210\301\322\323#\210\301\324\325#\210\301\326\327#\210\301\330\331#\210\301\332\333#\210\301\334\335#\210\336\337!\207" [lua-mode-menu define-key [restart-with-whole-file] ("Restart With Whole File" . lua-restart-with-whole-file) [kill-process] ("Kill Process" . lua-kill-process) [hide-process-buffer] ("Hide Process Buffer" . lua-hide-process-buffer) [show-process-buffer] ("Show Process Buffer" . lua-show-process-buffer) [end-of-proc] ("End Of Proc" . lua-end-of-proc) [beginning-of-proc] ("Beginning Of Proc" . lua-beginning-of-proc) [send-lua-region] ("Send Lua-Region" . lua-send-lua-region) [set-lua-region-end] ("Set Lua-Region End" . lua-set-lua-region-end) [set-lua-region-start] ("Set Lua-Region Start" . lua-set-lua-region-start) [send-current-line] ("Send Current Line" . lua-send-current-line) [send-region] ("Send Region" . lua-send-region) [send-proc] ("Send Proc" . lua-send-proc) [send-buffer] ("Send Buffer" . lua-send-buffer) [search-documentation] ("Search Documentation" . lua-search-documentation) provide lua-mode] 4)