[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 3ba5bf1 059/468: Redo lua-toggle-electric-state,
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 3ba5bf1 059/468: Redo lua-toggle-electric-state, remove extra function lua-calculate-state |
Date: |
Thu, 5 Aug 2021 04:58:08 -0400 (EDT) |
branch: elpa/lua-mode
commit 3ba5bf1c9ddb2b9fff348664c5dda0caace16ff7
Author: immerrr <immerrr@gmail.com>
Commit: immerrr <immerrr@gmail.com>
Redo lua-toggle-electric-state, remove extra function lua-calculate-state
---
lua-mode.el | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index de643f4..f4d372a 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1055,29 +1055,24 @@ t, otherwise return nil. BUF must exist."
(interactive)
(browse-url (concat lua-search-url-prefix (current-word t))))
-(defun lua-calculate-state (arg prevstate)
- ;; Calculate the new state of PREVSTATE, t or nil, based on arg. If
- ;; arg is nil or zero, toggle the state. If arg is negative, turn
- ;; the state off, and if arg is positive, turn the state on
- (if (or (not arg)
- (zerop (setq arg (prefix-numeric-value arg))))
- (not prevstate)
- (> arg 0)))
-
(defun lua-toggle-electric-state (&optional arg)
"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."
(interactive "P")
- (setq lua-electric-flag (lua-calculate-state arg lua-electric-flag)))
+ (let ((num_arg (prefix-numeric-value arg)))
+ (setq lua-electric-flag (cond ((or (null arg)
+ (zerop num_arg)) (not
lua-electric-flag))
+ ((< num_arg 0) nil)
+ ((> num_arg 0) t))))
+ (message "%S" lua-electric-flag))
(defun lua-forward-sexp (&optional count)
"Forward to block end"
(interactive "p")
(save-match-data
(let* ((count (or count 1))
- (stackheight 0)
(block-start (mapcar 'car lua-sexp-alist))
(block-end (mapcar 'cdr lua-sexp-alist))
(block-regex (regexp-opt (append block-start block-end) 'words))
- [nongnu] elpa/lua-mode d7c462a 030/468: Fix bug #620: Wrong identation with tables, (continued)
- [nongnu] elpa/lua-mode d7c462a 030/468: Fix bug #620: Wrong identation with tables, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode eebb50c 035/468: Fix #1913: Indenting: "(" like "{", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode fc0a1e3 036/468: Changes/Fixes by Reuben Thomas:, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode de08e4b 028/468: Added version comment for Tom Tromeys package.el, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 676f0a6 045/468: Sync with reality., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 239783b 046/468: Bump version., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a5f8e7b 048/468: Fix generation and use of VERSION, and ignore release notes files., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 14300f1 049/468: Specify branch to pull from., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 60073cc 050/468: Change https to http in URL., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7af5dec 057/468: Use line-beginning(-end)-position when possible, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3ba5bf1 059/468: Redo lua-toggle-electric-state, remove extra function lua-calculate-state,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode e610db4 060/468: lua-make-indentation-info-pair: readability refactoring, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cc46763 061/468: Add some comments, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b2860f1 062/468: lua-setup-keymap: improve readability, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7935b5f 064/468: Fix previous commit, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 85d26f8 065/468: lua-mode-map: initialize as soon as lua-mode is loaded (previously waited for call to lua-mode), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3339da6 067/468: lua-prefix-key: auto-convert from/to character, update bindings automagically, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 5842703 068/468: Add TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8165775 069/468: Fix lua-set-prefix message, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6b1d389 074/468: lua-calculate-unindentation: skip semicolons as well, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode bda4fbd 075/468: lua-calculate-unindentation: update docs, remove extraneous catch, Philip Kaludercic, 2021/08/05