From: Stefan Monnier Date: Sun, 5 Sep 2010 09:44:55 +0000 (+0200) Subject: * emacs-lisp/rx.el (rx-any): Don't explode ranges that end in - or ]. X-Git-Tag: emacs-pretest-23.2.90~134^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=19fe13dfd1d44483bca28b4ad57c55ac1ef68892;p=emacs.git * 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 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea973172b3a..21eaa4c15d3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2010-09-05 Stefan Monnier + + * 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 * textmodes/bibtex.el: diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 85fe3514b01..522d452c2dc 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)))