[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 79e6815 216/468: Rewrite lua-beginning-of-proc
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 79e6815 216/468: Rewrite lua-beginning-of-proc |
Date: |
Thu, 5 Aug 2021 04:58:39 -0400 (EDT) |
branch: elpa/lua-mode
commit 79e681530b17c7be227208b94ae407cdd9118ee4
Author: immerrr <immerrr@gmail.com>
Commit: immerrr <immerrr@gmail.com>
Rewrite lua-beginning-of-proc
---
lua-mode.el | 36 ++++++++++++++----------------------
1 file changed, 14 insertions(+), 22 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 9121753..7b1db51 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1482,32 +1482,24 @@ If not, return nil."
(defun lua-beginning-of-proc (&optional arg)
"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."
(interactive "P")
- (or arg
- (setq arg 1))
- (let ((found nil)
- (ret t))
- (while (< arg 0)
- (if (re-search-forward "^function[ \t]" nil t)
- (setq arg (1+ arg)
- found t)
- (setq ret nil
- arg 0)))
- (if found
- (beginning-of-line))
- (if (> arg 0)
- (if (re-search-forward "^function[ \t]" nil t)
- (setq arg (1+ arg))
- (goto-char (point-max))))
- (while (> arg 0)
- (if (re-search-backward "^function[ \t]" nil t)
- (setq arg (1- arg))
- (setq ret nil
- arg 0)))
- ret))
+ (or arg (setq arg 1))
+
+ (while (and (> arg 0)
+ (re-search-backward "^function[ \t]" nil t))
+ (setq arg (1- arg)))
+
+ (while (and (< arg 0)
+ (re-search-forward "^function[ \t]" nil t))
+ (beginning-of-line)
+ (setq arg (1+ arg)))
+
+ (zerop arg))
(defun lua-end-of-proc (&optional arg)
"Move forward to next end of lua proc (or similar).
- [nongnu] elpa/lua-mode 57c696c 192/468: Add var name highlighting in "for x, y in ..." construct, (continued)
- [nongnu] elpa/lua-mode 57c696c 192/468: Add var name highlighting in "for x, y in ..." construct, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 97ce427 198/468: Restore compatibility with Emacs23 broken by commit 8d28342, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ff3f5e1 199/468: lua-font-lock-keywords: don't eval-when-compile initial value, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2a0314b 200/468: Improve multiline highlighting via font-lock-syntactic-keywords, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cd5c071 201/468: Clean up lua-mode start-up function a bit, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b195cdc 205/468: Bump TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cee511c 206/468: for/local varname highlighting: match '=' at EOL properly, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a1dc850 207/468: Post-refactoring fix: evaluate string variables in font-lock-defaults value, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8ffd075 208/468: lua-calculate-indentation-info: non-functional refactoring, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4484128 215/468: lua-calculate-indentation-override: unindent to the last block-close token, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 79e6815 216/468: Rewrite lua-beginning-of-proc,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode f2e7138 220/468: Move font-lock test helpers into a separate file, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 94aadfd 221/468: Font-lock "nil", "true" and "false" as constants rather than keywords, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 617c392 224/468: make test: test both compiled and uncompiled variants, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7157658 225/468: Create cask project; pull in ert.el to enable testing emacs23, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ed76a6e 227/468: .gitignore: ignore all *.elc, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 67a9022 229/468: test-electric-mode: check interaction with electric-pair-skip-self flag, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b10d6ae 232/468: Add missing modulo operator (%) to line-continuation tokens, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2d308e8 237/468: Move "no-query-on-exit" initialization to lua-start-process, update it, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 397b883 236/468: Send code to inferior process via loadstring to avoid tempfile issues, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 24cc45e 239/468: Skip shebang line when sending to inferior buffer (issue #61), Philip Kaludercic, 2021/08/05