diff options
Diffstat (limited to '.emacs.d/lisp/lua-mode.el')
| -rw-r--r-- | .emacs.d/lisp/lua-mode.el | 23 |
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 | ||
| 997 | Direction is one of 'forward and 'backward. | 998 | Direction is one of \\='forward and \\='backward. |
| 998 | 999 | ||
| 999 | Matches in comments and strings are ignored. If the regexp is | 1000 | Matches in comments and strings are ignored. If the regexp is |
| 1000 | found, returns point position, nil otherwise." | 1001 | found, 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. |
| 1098 | Point has to be exactly at the beginning of TOKEN, e.g. with | being point | 1099 | Point 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 | ||
| 1105 | DIRECTION has to be either 'forward or 'backward." | 1106 | DIRECTION 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 | |||
| 1177 | the matching token if successful, nil otherwise. | 1178 | the matching token if successful, nil otherwise. |
| 1178 | 1179 | ||
| 1179 | Optional PARSE-START is a position to which the point should be moved first. | 1180 | Optional PARSE-START is a position to which the point should be moved first. |
| 1180 | DIRECTION has to be 'forward or 'backward ('forward by default)." | 1181 | DIRECTION 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 | ||
| 1288 | This regexp starts from eol and looks for a binary operator or an unclosed | 1289 | This regexp starts from eol and looks for a binary operator or an unclosed |
| 1289 | block intro (i.e. 'for' without 'do' or 'if' without 'then') followed by | 1290 | block intro (i.e. `for' without `do' or `if' without `then') followed by |
| 1290 | an optional whitespace till the end of the line.") | 1291 | an 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 | ||
| 1590 | When a replace-matching token is seen, the last recorded info is removed, | 1591 | When a replace-matching token is seen, the last recorded info is removed, |
| 1591 | and the cdr of the replace-matching info is added in its place. This is used | 1592 | and the cdr of the replace-matching info is added in its place. This is used |
| 1592 | when a middle-of the block (the only case is 'else') is seen on the same line | 1593 | when a middle-of the block (the only case is `else') is seen on the same line |
| 1593 | the block is opened." | 1594 | the 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 | |||
| 1755 | indentation rather then to block-open token. | 1756 | indentation rather then to block-open token. |
| 1756 | 1757 | ||
| 1757 | For example: | 1758 | For 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() |
