summaryrefslogtreecommitdiff
path: root/lisp/nxml
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-12-02 12:23:13 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-02 12:23:13 +0100
commitb31e7c51d604eecef0602cf2e3c0cf469db3edc9 (patch)
treef47509bea02c083f2079f129904a87876bf56ecc /lisp/nxml
parentbf43bcbed81ba0fa4376bcd6568279fa3c519c3a (diff)
downloademacs-b31e7c51d604eecef0602cf2e3c0cf469db3edc9.tar.gz
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.
Diffstat (limited to 'lisp/nxml')
-rw-r--r--lisp/nxml/xsd-regexp.el8
1 files changed, 7 insertions, 1 deletions
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