Fix merge mistake
[bpt/emacs.git] / lisp / emacs-lisp / regexp-opt.el
index 34cd977..18bd094 100644 (file)
@@ -1,7 +1,7 @@
 ;;; regexp-opt.el --- generate efficient regexps to match strings
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-;;   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Simon Marshall <simon@gnu.org>
 ;; Maintainer: FSF
@@ -11,7 +11,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -263,13 +263,21 @@ This means the number of non-shy regexp grouping constructs
     (map-char-table
      (lambda (c v)
        (when v
-        (if (= (1- c) end) (setq end c)
-          (if (> end (+ start 2))
+        (if (consp c)
+            (if (= (1- (car c)) end) (setq end (cdr c))
+              (if (> end (+ start 2))
+                  (setq charset (format "%s%c-%c" charset start end))
+                (while (>= end start)
+                  (setq charset (format "%s%c" charset start))
+                  (incf start)))
+              (setq start (car c) end (cdr c)))
+          (if (= (1- c) end) (setq end c)
+            (if (> end (+ start 2))
               (setq charset (format "%s%c-%c" charset start end))
             (while (>= end start)
               (setq charset (format "%s%c" charset start))
               (incf start)))
-          (setq start c end c))))
+            (setq start c end c)))))
      charmap)
     (when (>= end start)
       (if (> end (+ start 2))