summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/regexp-opt.el
diff options
context:
space:
mode:
authorSimon Marshall <simon@gnu.org>1997-06-27 07:22:37 +0000
committerSimon Marshall <simon@gnu.org>1997-06-27 07:22:37 +0000
commit7618f018afaf76fc4d84b6fbb7f62fec54cfee2f (patch)
tree7c34798e06b44db7ecae9a545b8832548c178a6f /lisp/emacs-lisp/regexp-opt.el
parenta26b96440ffba2e78b9f2a4089263465bd06150b (diff)
downloademacs-7618f018afaf76fc4d84b6fbb7f62fec54cfee2f.tar.gz
simplify.
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
-rw-r--r--lisp/emacs-lisp/regexp-opt.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el
index 140fd8005dd..f8b733041e2 100644
--- a/lisp/emacs-lisp/regexp-opt.el
+++ b/lisp/emacs-lisp/regexp-opt.el
@@ -4,7 +4,7 @@
;; Author: Simon Marshall <simon@gnu.ai.mit.edu>
;; Keywords: strings, regexps
-;; Version: 1.05
+;; Version: 1.05.01
;; This file is part of GNU Emacs.
@@ -220,14 +220,14 @@ in REGEXP."
(aset charmap char t))))
;;
;; Make a character set from the map using ranges where applicable.
- (dotimes (elt charwidth)
- (when (aref charmap elt)
- (let ((start elt))
- (while (and (< elt charwidth) (aref charmap elt))
- (incf elt))
- (if (> (- elt start) 3)
- (setq charset (format "%s%c-%c" charset start (1- elt)))
- (setq charset (format "%s%c" charset (setq elt start)))))))
+ (dotimes (char charwidth)
+ (let ((start char))
+ (while (and (< char charwidth) (aref charmap char))
+ (incf char))
+ (cond ((> char (+ start 3))
+ (setq charset (format "%s%c-%c" charset start (1- char))))
+ ((> char start)
+ (setq charset (format "%s%c" charset (setq char start)))))))
;;
;; Make sure a caret is not first and a dash is first or last.
(if (and (string-equal charset "") (string-equal bracket ""))