aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2010-09-05 11:44:55 +0200
committerStefan Monnier <[email protected]>2010-09-05 11:44:55 +0200
commit19fe13dfd1d44483bca28b4ad57c55ac1ef68892 (patch)
treeb9f1db5589763d4699e50755fd1a7dcb3b80ff76 /lisp/emacs-lisp
parent89532a078eec050920b444be8d011e952c53157f (diff)
* emacs-lisp/rx.el (rx-any): Don't explode ranges that end in - or ].
(rx-any-condense-range): Explode 2-char ranges. Fixes: debbugs:6984
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/rx.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 85fe3514b0..522d452c2d 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -427,7 +427,7 @@ Only both edges of each range is checked."
(mapcar (lambda (e)
(cond
((= (car e) (cdr e)) (list (car e)))
- ;; ((= (1+ (car e)) (cdr e)) (list (car e) (cdr e)))
+ ((= (1+ (car e)) (cdr e)) (list (car e) (cdr e)))
((list e))))
l))
(delete-dups str))))
@@ -545,7 +545,10 @@ ARG is optional."
((numberp e) (string e))
((consp e)
(if (and (= (1+ (car e)) (cdr e))
- (null (memq (car e) '(?\] ?-))))
+ ;; rx-any-condense-range should
+ ;; prevent this case from happening.
+ (null (memq (car e) '(?\] ?-)))
+ (null (memq (cdr e) '(?\] ?-))))
(string (car e) (cdr e))
(string (car e) ?- (cdr e))))
(e)))