]> git.eshelyaron.com Git - emacs.git/commit
Eliminate some nested repetitions in regexps
authorMattias Engdegård <mattiase@acm.org>
Thu, 5 Oct 2023 12:06:24 +0000 (14:06 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sun, 29 Oct 2023 16:40:36 +0000 (17:40 +0100)
commit67977ae5974e54d34034aa7990cf22dd162c179b
treeed2ca05d33da296d0dbccc91748c7e77b295771b
parent7e47d88499f3296eb314a12f483292d9154307de
Eliminate some nested repetitions in regexps

Nested repetitions such as (A*)* potentially take exponential time but
can usually be rewritten in a faster and more readable way without
much trouble.  These were all found by Relint.

* lisp/obsolete/terminal.el (te-parse-program-and-args):
* lisp/org/org.el (org-make-tags-matcher):
Apply the transform (A+B*)+ -> A(A|B)*

* lisp/textmodes/fill.el (adaptive-fill-regexp):
Apply the transform A*(B+A*)* -> (A|B)*

* lisp/progmodes/idlw-shell.el (idlwave-shell-filter):
Find the last newline or CR in a more direct way.

* lisp/progmodes/vhdl-mode.el (vhdl-port-copy, vhdl-subprog-copy):
Trim trailing whitespace from a string in a more direct way.
All-whitespace strings are left unchanged as before.
lisp/obsolete/terminal.el
lisp/org/org.el
lisp/progmodes/idlw-shell.el
lisp/progmodes/vhdl-mode.el
lisp/textmodes/fill.el