1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Add multi-character pairs to lua-ts-mode and texinfo-mode

* etc/NEWS: Add entry for lua-ts-mode changes.
* lisp/progmodes/lua-ts-mode.el
(lua-ts-auto-close-block-comments): New user option.
(lua-ts-mode): Add '--[[ ]]' pairs to 'electric-pair-pairs' only
if 'lua-ts-auto-close-block-comments' is non-nil.
* lisp/textmodes/texinfo.el (texinfo-mode): Add "`` ''" pairs to
'electric-pair-pairs'.
* test/lisp/progmodes/lua-ts-mode-tests.el
(lua-ts-test-auto-close-block-comments): Add new test.
(Bug#79047)
This commit is contained in:
Elías Gabriel Pérez 2025-08-04 12:47:18 -06:00 committed by Eli Zaretskii
parent 477e44fca3
commit e4352c7a45
4 changed files with 70 additions and 0 deletions

View file

@ -74,6 +74,11 @@
:safe 'natnump
:version "30.1")
(defcustom lua-ts-auto-close-block-comments nil
"If non-nil, inserting a block comment \"--[[\" will insert its respective \"]]\"."
:type 'boolean
:version "31.1")
(defcustom lua-ts-luacheck-program "luacheck"
"Location of the Luacheck program."
:type 'file
@ -675,6 +680,14 @@ Calls REPORT-FN directly."
(setq-local comment-start-skip "--\\s-*")
(setq-local comment-end "")
;; Pairs.
(when (and lua-ts-auto-close-block-comments
(boundp 'electric-pair-pairs))
(setq-local electric-pair-pairs
(cons
'("--\\[\\[" . "\n]")
electric-pair-pairs)))
;; Font-lock.
(setq-local treesit-font-lock-settings lua-ts--font-lock-settings)
(setq-local treesit-font-lock-feature-list