[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66466: [PATCH] Support lua-ts-mode in align.el
From: |
john muhl |
Subject: |
bug#66466: [PATCH] Support lua-ts-mode in align.el |
Date: |
Thu, 12 Oct 2023 22:13:56 -0500 |
Stefan Kangas <stefankangas@gmail.com> writes:
> john muhl via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" <bug-gnu-emacs@gnu.org> writes:
>
>> Add support for using align in Lua files.
>
> nThanks.
>
>> diff --git a/lisp/align.el b/lisp/align.el
>> index a286addb51f..e6e62ce5726 100644
>> --- a/lisp/align.el
>> +++ b/lisp/align.el
>> @@ -577,7 +577,23 @@ align-rules-list
>> "="
>> (group (zero-or-more (syntax whitespace)))))
>> (group . (1 2))
>> - (modes . '(conf-toml-mode toml-ts-mode))))
>> + (modes . '(conf-toml-mode toml-ts-mode)))
>> +
>> + (lua-assignment
>> + (regexp . ,(concat "\\(?:^\\(?:\\s-*\\(?:local\\s-+\\)?\\(?:[,<>_]"
>> + "\\|\\w\\)+\\)+\\(\\s-*\\)=\\(\\s-*\\)\\)"))
>> + (group . (1 2))
>> + (modes . '(lua-ts-mode))
>> + (tab-stop . nil))
>> +
>> + (lua-comment
>> + (regexp . "\\(?:\\(\\s-*\\)--.*\\)")
>> + (modes . '(lua-ts-mode))
>> + (column . comment-column)
>> + (valid . ,(lambda ()
>> + (save-excursion
>> + (goto-char (match-beginning 1))
>> + (not (bolp)))))))
>
> Should `lua-mode' also be in `modes'?
lua-mode is only available from non-GNU ELPA so I wasn’t sure. If that’s
not a factor I’ll add it.