]> git.eshelyaron.com Git - emacs.git/commit
Fix rx wrong-code bug: ranges starting with ^
authorMattias Engdegård <mattiase@acm.org>
Sun, 30 Jul 2023 13:30:38 +0000 (15:30 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sun, 30 Jul 2023 16:12:19 +0000 (18:12 +0200)
commit2b8796eea1979fe6891ab9d80cd126fe8980167a
tree0e49ad64bf11942baf797aecf87723ecc8842f00
parentba60070b81c4b507b856269031a17b99e9f5e77c
Fix rx wrong-code bug: ranges starting with ^

(rx (in (?^ . ?a))) was incorrectly translated to "[^-a]".
Change it so that we get "[_-a^]" instead.

* lisp/emacs-lisp/rx.el (rx--generate-alt): Split ranges starting with
`^` occurring first in a non-negated character alternative.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add and adapt tests.

(cherry picked from commit 5f5d668ac7917d61e9366fe0c3efd7b542671c3d)
lisp/emacs-lisp/rx.el
test/lisp/emacs-lisp/rx-tests.el