]> git.eshelyaron.com Git - emacs.git/commitdiff
(reb-update-overlays): Do not mark zero-width regexps as invalid
authorJuanma Barranquero <lekktu@gmail.com>
Sun, 18 Mar 2007 14:34:18 +0000 (14:34 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Sun, 18 Mar 2007 14:34:18 +0000 (14:34 +0000)
but rather at least count them correctly.

lisp/ChangeLog
lisp/emacs-lisp/re-builder.el

index 32b3e71373d612fbb162513f29b61d55b223d211..35a8ed7894320c9e0ad3bf4c95e3ddb1370e835e 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-18  Detlev Zundel  <dzu@gnu.org>
+
+       * emacs-lisp/re-builder.el (reb-update-overlays): Do not mark zero-width
+       regexps as invalid but rather at least count them correctly.
+
 2007-03-18  Thien-Thi Nguyen  <ttn@gnu.org>
 
        * net/tls.el (open-tls-stream): In handshake-waiting loop,
index dc4562ab9bbd6295b6bc457e953e57d7f8cdd3ec..2d3b4832cdab11eab99978a57cf8d8c072c43b9d 100644 (file)
@@ -639,11 +639,13 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
       (set-buffer reb-target-buffer)
       (reb-delete-overlays)
       (goto-char (point-min))
-      (while (and (re-search-forward re (point-max) t)
+      (while (and (not (eobp))
+                 (re-search-forward re (point-max) t)
                  (or (not reb-auto-match-limit)
                      (< matches reb-auto-match-limit)))
        (if (= 0 (length (match-string 0)))
-           (error "Empty regular expression!"))
+           (unless (eobp)
+             (forward-char 1)))
        (let ((i 0)
              suffix max-suffix)
          (setq matches (1+ matches))