[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 918f297 072/468: rename: lua-calculate-indentatio
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 918f297 072/468: rename: lua-calculate-indentation-left-shift -> lua-calculate-unindentation |
Date: |
Thu, 5 Aug 2021 04:58:10 -0400 (EDT) |
branch: elpa/lua-mode
commit 918f2979db755d69066c6c21f4923b6d71157b3f
Author: immerrr <immerrr@gmail.com>
Commit: immerrr <immerrr@gmail.com>
rename: lua-calculate-indentation-left-shift -> lua-calculate-unindentation
---
lua-mode.el | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index d2d1831..2ab926b 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -421,7 +421,7 @@ This function replaces previous prefix-key binding with a
new one."
"Indent current line for Lua mode.
Return the amount the indentation changed by."
(let ((indent (max 0 (- (lua-calculate-indentation nil)
- (lua-calculate-indentation-left-shift))))
+ (lua-calculate-unindentation))))
(beg (line-beginning-position))
shift-amt
(case-fold-search nil)
@@ -775,7 +775,7 @@ one."
(or (and (lua-last-token-continues-p) lua-indent-level)
(and (lua-forward-line-skip-blanks)
(lua-first-token-continues-p) lua-indent-level)
0)))
- (+ (lua-calculate-indentation-left-shift)
+ (+ (lua-calculate-unindentation)
(cdr indentation-info)
(if (lua-is-continuing-statement-p) (- lua-indent-level) 0)))))
@@ -784,13 +784,12 @@ one."
"\\(?1:\\_<" (regexp-opt '("else" "elseif" "until" "end")) "\\_>"
"\\|" (regexp-opt '("]" "}" ")")) "\\)"))
-(defun lua-calculate-indentation-left-shift (&optional parse-start)
+(defun lua-calculate-unindentation (&optional parse-start)
"Return amount, by which this line should be shifted left.
Look for an uninterrupted sequence of block-closing tokens that starts
at the beginning of the line. For each of these tokens, shift indentation
to the left by the amount specified in lua-indent-level."
- (let ((line-begin (line-beginning-position))
- (indentation-modifier 0)
+ (let ((indentation-modifier 0)
(case-fold-search nil)
(block-token nil))
(save-excursion
@@ -798,11 +797,9 @@ to the left by the amount specified in lua-indent-level."
(back-to-indentation)
;; Look for the block-closing token sequence
(catch 'stop
- (while (and (looking-at lua-left-shift-regexp)
+ (while (and (looking-at lua-unindentation-regexp)
(not (lua-comment-or-string-p)))
- (let ((last-token (or (match-string 1) (match-string 2))))
- (if (not block-token) (setq block-token last-token))
- (if (not (string-equal block-token last-token)) (throw 'stop nil))
+ (let ((last-token (match-string 1)))
(setq indentation-modifier (+ indentation-modifier
lua-indent-level))
(forward-char (length (match-string 0))))))
- [nongnu] elpa/lua-mode 66cd58a 171/468: Fix test_indentation.sh, add basic_blocks.lua indentation test, (continued)
- [nongnu] elpa/lua-mode 66cd58a 171/468: Fix test_indentation.sh, add basic_blocks.lua indentation test, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4b27305 097/468: Add safe default target to makefile, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ddcd8b8 102/468: Makefile: specify dist contents explicitly, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode aa10440 148/468: Bump TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8638475 174/468: Fix use of flet for Emacs > 24.1, and enable assert., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode f926323 180/468: Extend and unify backward compatibility code, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6245e50 190/468: Add helper functions for reimplementation of font-lock-keywords, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 40c00bf 189/468: lua-font-lock-keywords: fontify constants/builtins first, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3a3f0b0 193/468: Improve local var assignment matching, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode af50eca 195/468: Bump copyright information (no luck with FSF), rephrase comment, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 918f297 072/468: rename: lua-calculate-indentation-left-shift -> lua-calculate-unindentation,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode cf2f42a 076/468: .gitignore: ignore emacs backups, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9384855 093/468: lua-mark-all-multiline-literals: run when during lua-mode initialization, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6de08c0 090/468: Update TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e3a8282 099/468: Make URL/Version fields in lua-mode.el prettier, update parse expression in Makefile, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1c37d0d 114/468: Bump version, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e17a48c 126/468: Give credit to people participated recently, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dcf5fc1 138/468: Indentation fixes and tidy up., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3c8cfe6 160/468: Add credit, reformat new code to fit into 77 cols, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6b48a94 165/468: Second part of the fix for #34, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7a3a5f6 169/468: Add script to facilitate indentation testing, Philip Kaludercic, 2021/08/05