GNU bug report logs - #79309
lua-mode: minor problems and suggestions

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Date: Mon, 25 Aug 2025 14:54:01 UTC

Severity: normal

Done: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#79309: closed (lua-mode: minor problems and suggestions)
Date: Wed, 27 Aug 2025 08:17:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 27 Aug 2025 10:15:50 +0200
with message-id <2D13E6CB-F9AD-427E-8AFB-EB517B2B8D30 <at> gmail.com>
and subject line Re: bug#79309: lua-mode: minor problems and suggestions
has caused the debbugs.gnu.org bug report #79309,
regarding lua-mode: minor problems and suggestions
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
79309: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79309
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Emacs Bug Report <bug-gnu-emacs <at> gnu.org>
Cc: john muhl <jm <at> pub.pink>, Juergen Hoetzel <juergen <at> hoetzel.info>
Subject: lua-mode: minor problems and suggestions
Date: Mon, 25 Aug 2025 16:52:59 +0200
Some observations about the recently added lua-mode.el:

 394   "A regexp that matches Lua builtin functions & variables.
 395 
 396 This is a compilation of 5.1, 5.2 and 5.3 builtins taken from the
 397 index of respective Lua reference manuals.")

Clearly meant as a doc string. Bracket error?

1266            (or

This `or` has only a single operand. Simple oversight or indication of something worse?

1270                (save-excursion
1271                  (and (goto-char prev-line)
1272                       ;; Check last token of previous nonblank line
1273                       (lua-last-token-continues-p)))))

`goto-char` never returns nil, but its presence as a condition here suggest that the author may have thought otherwise. (Line 996 is similar.)

2099         for type = (if (string-match-p "\\`(E" msg) :error :warning)

A regexp is overkill here; `string-prefix-p` is simpler.

1821       (while (re-search-forward "[\"'\\\t\\\n]" nil t)

This regexp is a bit muddled; too many backslashes here.
You could even rewrite the whole function using `replace-regexp-in-string`, maybe

  (concat "'"
          (replace-regexp-in-string
           (rx (or ?\" ?' ?\t ?\n ?\\))
           (lambda (s)
             (cdr (assq (aref s 0) '((?\" . "\\\"")
                                     (?\\ . "\\\\")
                                     (?\n . "\\n")
                                     (?\t . "\\t")
                                     (?'  . "\\'")))))
           str t t)
          "'"))

without any need for a temporary buffer.



[Message part 3 (message/rfc822, inline)]
From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: john muhl <jm <at> pub.pink>
Cc: 79309-done <at> debbugs.gnu.org
Subject: Re: bug#79309: lua-mode: minor problems and suggestions
Date: Wed, 27 Aug 2025 10:15:50 +0200
27 aug. 2025 kl. 05.35 skrev john muhl <jm <at> pub.pink>:

> Thanks for the review. Attached patch fixes these and a few other
> little things.

Looks good, thank you! Pushing to master and closing bug.



This bug report was last modified 9 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.