]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix xsdre-range-list-to-char-alternative problem with {P}
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 2 Dec 2020 11:23:13 +0000 (12:23 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 2 Dec 2020 11:23:13 +0000 (12:23 +0100)
* lisp/nxml/xsd-regexp.el (xsdre-range-list-to-char-alternative):
Make (string-match (xsdre-translate "\\p{P}") "a-b") work
(bug#24093) -- the "forbidden" characters don't have to be the
first elements in a range.

lisp/nxml/xsd-regexp.el

index 622ba911995357ad22284309c827bdbeee992dd1..3ce59b7556084cfbf1bed75504ec555e58fe806c 100644 (file)
@@ -387,9 +387,15 @@ consisting of a single char alternative delimited with []."
                        ((eq first ?-)
                         (setq hyphen t)
                         (setq first (1+ first)))
+                       ((eq last ?-)
+                        (setq hyphen t)
+                        (setq last (1- last)))
                        ((eq first ?\])
                         (setq close-bracket t)
-                        (setq first (1+ first))))
+                        (setq first (1+ first)))
+                       ((eq last ?\])
+                        (setq close-bracket t)
+                        (setq last (1- last))))
                  (<= first last)))
       (when (<= first last)
        (setq chars