From b31e7c51d604eecef0602cf2e3c0cf469db3edc9 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 2 Dec 2020 12:23:13 +0100 Subject: [PATCH] Fix xsdre-range-list-to-char-alternative problem with {P} * 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el index 622ba911995..3ce59b75560 100644 --- a/lisp/nxml/xsd-regexp.el +++ b/lisp/nxml/xsd-regexp.el @@ -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 -- 2.39.5