summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/regexp-opt.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
-rw-r--r--lisp/emacs-lisp/regexp-opt.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el
index 3e0c7c8ade4..a5293f2684c 100644
--- a/lisp/emacs-lisp/regexp-opt.el
+++ b/lisp/emacs-lisp/regexp-opt.el
@@ -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))