changeset 110231:6d4cb5e730cb

* emacs-lisp/rx.el (rx-any): Don't explode ranges that end in - or ]. (rx-any-condense-range): Explode 2-char ranges.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 05 Sep 2010 11:44:55 +0200
parents 81205f94f02b
children e0108443f3b5
files lisp/ChangeLog lisp/emacs-lisp/rx.el
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Sep 04 14:58:56 2010 -0400
+++ b/lisp/ChangeLog	Sun Sep 05 11:44:55 2010 +0200
@@ -1,3 +1,9 @@
+2010-09-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/rx.el (rx-any): Don't explode ranges that end in special
+	chars like - or ] (bug#6984).
+	(rx-any-condense-range): Explode 2-char ranges.
+
 2010-09-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* textmodes/bibtex.el:
--- a/lisp/emacs-lisp/rx.el	Sat Sep 04 14:58:56 2010 -0400
+++ b/lisp/emacs-lisp/rx.el	Sun Sep 05 11:44:55 2010 +0200
@@ -427,7 +427,7 @@
 	    (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 @@
 			    ((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)))