1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-11 17:31:35 -07:00
Commit graph

19 commits

Author SHA1 Message Date
john muhl
bba28b744c Make 'lua-prefix-key' option a 'key-sequence'
This fixes a failure in 'test-custom-opts' caused by both strings
and integers being used for 'lua-prefix-key'.

* lisp/progmodes/lua-mode.el (lua-prefix-key): Convert option to
'key-sequence' type.
(lua-mode-map, lua-prefix-key-update-bindings, lua-set-prefix-key)
(lua--customize-set-prefix-key): Adjust to the change of type for
'lua-prefix-key'.
(lua-prefix-mode-map): Use 'defvar-keymap'.  (Bug#79335)
2025-08-29 09:47:24 +02:00
john muhl
f908d854d6 ; Various code cleanup in 'lua-mode' (Bug#79309)
* lisp/progmodes/lua-mode.el (lua-indent-level): Contemporary Lua
style guides no longer recommend 3 as default. Change type to
'natnum'.
(lua-always-show, lua-get-block-token-info)
(lua--backward-up-list-noerror, lua-make-indentation-info-pair)
(lua-accumulate-indentation-info)
(lua-calculate-indentation-block-modifier): Quote function names.
(lua-toggle-electric-state): Re-format to avoid confusion.
(lua-is-continuing-statement-p-1): Fix typo.
(lua--builtins): Move docstring to correct location.
(lua-is-continuing-statement-p-1): Remove unnecessary 'or'.
(lua-make-lua-string): Remove excessive backslashes and
unnecessary use of a temporary buffer.
(lua-find-matching-token-word): Make it clear that 'goto-char' is
only used only for its side-effect.
2025-08-27 10:05:49 +02:00
john muhl
c042611106 Add warn to 'lua-mode' builtins
* lisp/progmodes/lua-mode.el (lua--builtins): Include warn.
2025-08-25 09:59:04 +08:00
john muhl
22e3ba30fa ; Improve compliance of 'lua-mode'
* lisp/progmodes/lua-mode.el: Fix byte-compiler warnings, placate
checkdoc and improve consistency of comment formatting.
2025-08-25 09:59:04 +08:00
john muhl
7fabc65484 ; Update comments & requires in 'lua-mode' 2025-08-25 09:59:04 +08:00
john muhl
8af0064a74 Remove trivial cl-* stuff from 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-process-buffer, lua--signum):
Replace 'cl-assert'.
(lua-accumulate-indentation-info): Replace 'cl-dolist' with
'dolist'.
2025-08-25 09:59:04 +08:00
john muhl
426167a8f3 Replace big regexps w/ rx expressions in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-block-regexp)
(lua-indentation-modifier-regexp, lua-cont-eol-regexp)
(lua-cont-bol-regexp): Use rx.
2025-08-25 09:59:04 +08:00
john muhl
2e454bea03 ; Adjust code style in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-prefix-key)
(lua-goto-matching-block): Replace 'let...if' with 'if-let*'.
(lua--fill-paragraph, lua-goto-matching-block-token): Replace
'let...when' with 'when-let*'.
(lua-comment-start-pos): Replace 'unless..and' with 'if-let*'.
(lua-skip-ws-and-comments-backward)
(lua-skip-ws-and-comments-forward): Remove unnecessary 'setq'.
(lua-indent-line): Replace 'when...not' with 'unless'.
(lua-calculate-string-or-comment-indentation): Formatting.
(lua-find-matching-token-word): Remove a level of 'let' nesting,
replace 'when...not' with 'unless'.
(lua-indent-line): Combine 'setq's.
2025-08-25 09:59:04 +08:00
john muhl
bf9e502e70 Remove unnecessary 'progn' in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-accumulate-indentation-info)
(lua--goto-line-beginning-rightmost-closer): Delete.
2025-08-25 09:59:04 +08:00
john muhl
142f1b2a9b Replace 1-armed 'if' with 'when' in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua--customize-set-prefix-key)
(lua-electric-match, lua-prefix-key-update-bindings)
(lua-indent-line, lua-find-matching-token-word)
(lua-goto-matching-block-token, lua-last-token-continues-p)
(lua-is-continuing-statement-p)
(lua--goto-line-beginning-rightmost-closer, lua-start-process)
(lua-prompt-line): Replace.
2025-08-25 09:59:04 +08:00
john muhl
ee36cac7ba Prefer 'defvar-local' in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-default-command-switches)
(lua-electric-flag, lua--repl-buffer-p): Replace
'make-variable-buffer-local' with 'defvar-local'.
2025-08-25 09:59:04 +08:00
john muhl
fd6d5b65b5 Remove unnecessary 'setq' from 'lua-mode'
* lisp/progmodes/lua-mode.el (lua--rx-bindings): Combine variable
definition and assignment.
2025-08-25 09:59:04 +08:00
john muhl
2fe72d48d3 Cleanup whitespace in 'lua-mode' 2025-08-25 09:59:04 +08:00
john muhl
6465b3cbec Cleanup defcustoms in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-mode-hook): Add options.
(lua-indent-level, lua-comment-start, lua-comment-start-skip)
(lua-default-application, lua-default-command-switches)
(lua-always-show, lua-documentation-function)
(lua-documentation-url, lua-prefix-key, lua-prompt-regexp)
(lua-indent-string-contents)
(lua-indent-nested-block-content-align)
(lua-indent-close-paren-align, lua-jump-on-traceback)
(lua-mode-hook, lua-mode, lua-luacheck-program): Delete group,
add version.
2025-08-25 09:59:04 +08:00
john muhl
b7d13f0de0 Remove unnecessary code from 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-traceback-line-re)
(lua-start-process): compile.el has Lua support now.
2025-08-25 09:59:04 +08:00
john muhl
509c1af9fc Remove advice from 'lua-mode'
* lisp/progmodes/lua-mode.el (lua--compilation-find-file)
(compilation-find-file, lua--compilation-goto-locus)
(compilation-goto-locus): Delete.
2025-08-25 09:59:04 +08:00
john muhl
3fa5aa47be Use easy-menu in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-mode-menu): Delete.
(lua-mode-map): Use 'easy-menu-define'.
2025-08-25 09:59:04 +08:00
john muhl
0b1b967781 Remove obsolete code from 'lua-mode'
* lisp/progmodes/lua-mode.el: Remove Emacs<27 compatibility code.
(lua-emacs-menu): Remove XEmacs compatibility code.
2025-08-25 09:59:04 +08:00
Juergen Hoetzel
0d3504227a * lisp/progmodes/lua-mode.el: Import lua-mode. 2025-08-25 09:58:34 +08:00