]> git.eshelyaron.com Git - emacs.git/commitdiff
(regexp-opt-group): Compute HALF2 properly.
authorRichard M. Stallman <rms@gnu.org>
Mon, 20 Jan 2003 09:00:48 +0000 (09:00 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 20 Jan 2003 09:00:48 +0000 (09:00 +0000)
lisp/emacs-lisp/regexp-opt.el

index b746c8a22f3fdfd687ce65b2c9e9bcaafae25699..ea80801b610ab04aa8901d5036be6914e3b76da0 100644 (file)
@@ -223,7 +223,10 @@ so we can use character sets rather than grouping parenthesis."
              ;; particular letter and those that do not, and recurse on them.
              (let* ((char (char-to-string (string-to-char (car strings))))
                     (half1 (all-completions char strings))
-                    (half2 (nthcdr (length half1) strings)))
+                    (half2 strings))
+               ;; Remove from HALF2 whatever is in HALF1.
+               (dolist (elt half1)
+                 (setq half2 (delq elt half2)))
                (concat open-group
                        (regexp-opt-group half1)
                        "\\|" (regexp-opt-group half2)