summaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/lua-mode.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/lisp/lua-mode.el')
-rw-r--r--.emacs.d/lisp/lua-mode.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/.emacs.d/lisp/lua-mode.el b/.emacs.d/lisp/lua-mode.el
index 6ab4d43..6c524f5 100644
--- a/.emacs.d/lisp/lua-mode.el
+++ b/.emacs.d/lisp/lua-mode.el
@@ -330,8 +330,9 @@ Should be a list of strings."
330 :type 'string 330 :type 'string
331 :group 'lua 331 :group 'lua
332 :set 'lua--customize-set-prefix-key 332 :set 'lua--customize-set-prefix-key
333 :get '(lambda (sym) 333 :get (lambda (sym)
334 (let ((val (eval sym))) (if val (single-key-description (eval sym)) "")))) 334 (let ((val (eval sym)))
335 (if val (single-key-description (eval sym)) ""))))
335 336
336(defvar lua-mode-menu (make-sparse-keymap "Lua") 337(defvar lua-mode-menu (make-sparse-keymap "Lua")
337 "Keymap for lua-mode's menu.") 338 "Keymap for lua-mode's menu.")
@@ -994,7 +995,7 @@ placed before the string."
994(defun lua-find-regexp (direction regexp &optional limit) 995(defun lua-find-regexp (direction regexp &optional limit)
995 "Searches for a regular expression in the direction specified. 996 "Searches for a regular expression in the direction specified.
996 997
997Direction is one of 'forward and 'backward. 998Direction is one of \\='forward and \\='backward.
998 999
999Matches in comments and strings are ignored. If the regexp is 1000Matches in comments and strings are ignored. If the regexp is
1000found, returns point position, nil otherwise." 1001found, returns point position, nil otherwise."
@@ -1097,12 +1098,12 @@ TOKEN-TYPE determines where the token occurs on a statement. open indicates that
1097 "Find matching open- or close-token for TOKEN in DIRECTION. 1098 "Find matching open- or close-token for TOKEN in DIRECTION.
1098Point has to be exactly at the beginning of TOKEN, e.g. with | being point 1099Point has to be exactly at the beginning of TOKEN, e.g. with | being point
1099 1100
1100 {{ }|} -- (lua-find-matching-token-word \"}\" 'backward) will return 1101 {{ }|} -- (lua-find-matching-token-word \"}\" \\='backward) will return
1101 -- the first { 1102 -- the first {
1102 {{ |}} -- (lua-find-matching-token-word \"}\" 'backward) will find 1103 {{ |}} -- (lua-find-matching-token-word \"}\" \\='backward) will find
1103 -- the second {. 1104 -- the second {.
1104 1105
1105DIRECTION has to be either 'forward or 'backward." 1106DIRECTION has to be either \\='forward or \\='backward."
1106 (let* ((token-info (lua-get-block-token-info token)) 1107 (let* ((token-info (lua-get-block-token-info token))
1107 (match-type (lua-get-token-type token-info)) 1108 (match-type (lua-get-token-type token-info))
1108 ;; If we are on a middle token, go backwards. If it is a middle or open, 1109 ;; If we are on a middle token, go backwards. If it is a middle or open,
@@ -1177,7 +1178,7 @@ at the current point. Returns the point position of the first character of
1177the matching token if successful, nil otherwise. 1178the matching token if successful, nil otherwise.
1178 1179
1179Optional PARSE-START is a position to which the point should be moved first. 1180Optional PARSE-START is a position to which the point should be moved first.
1180DIRECTION has to be 'forward or 'backward ('forward by default)." 1181DIRECTION has to be \\='forward or \\='backward (\\='forward by default)."
1181 (if parse-start (goto-char parse-start)) 1182 (if parse-start (goto-char parse-start))
1182 (let ((case-fold-search nil)) 1183 (let ((case-fold-search nil))
1183 (if (looking-at lua-indentation-modifier-regexp) 1184 (if (looking-at lua-indentation-modifier-regexp)
@@ -1286,7 +1287,7 @@ Returns final value of point as integer or nil if operation failed."
1286 "Regexp that matches the ending of a line that needs continuation. 1287 "Regexp that matches the ending of a line that needs continuation.
1287 1288
1288This regexp starts from eol and looks for a binary operator or an unclosed 1289This regexp starts from eol and looks for a binary operator or an unclosed
1289block intro (i.e. 'for' without 'do' or 'if' without 'then') followed by 1290block intro (i.e. `for' without `do' or `if' without `then') followed by
1290an optional whitespace till the end of the line.") 1291an optional whitespace till the end of the line.")
1291 1292
1292(defconst lua-cont-bol-regexp 1293(defconst lua-cont-bol-regexp
@@ -1589,7 +1590,7 @@ block opening statement when it is closed.
1589 1590
1590When a replace-matching token is seen, the last recorded info is removed, 1591When a replace-matching token is seen, the last recorded info is removed,
1591and the cdr of the replace-matching info is added in its place. This is used 1592and the cdr of the replace-matching info is added in its place. This is used
1592when a middle-of the block (the only case is 'else') is seen on the same line 1593when a middle-of the block (the only case is `else') is seen on the same line
1593the block is opened." 1594the block is opened."
1594 (cond 1595 (cond
1595 ( (eq 'multiple (car pair)) 1596 ( (eq 'multiple (car pair))
@@ -1755,8 +1756,8 @@ token should be indented relative to left-shifter expression
1755indentation rather then to block-open token. 1756indentation rather then to block-open token.
1756 1757
1757For example: 1758For example:
1758 -- 'local a = ' is a left-shifter expression 1759 -- `local a = ' is a left-shifter expression
1759 -- 'function' is a block-open token 1760 -- `function' is a block-open token
1760 local a = function() 1761 local a = function()
1761 -- block contents is indented relative to left-shifter 1762 -- block contents is indented relative to left-shifter
1762 foobarbaz() 1763 foobarbaz()