diff options
| author | Simon Marshall | 1997-06-27 07:22:37 +0000 |
|---|---|---|
| committer | Simon Marshall | 1997-06-27 07:22:37 +0000 |
| commit | 9b51ba9e8a6d852e67d1a07fdfd9cd9e233501bc (patch) | |
| tree | e2481bcb6f8de8a5fc564c7091acc0b4ded97b25 | |
| parent | b14fbaa0082b9404d0f507f58bb02603f669167d (diff) | |
| download | emacs-9b51ba9e8a6d852e67d1a07fdfd9cd9e233501bc.tar.gz emacs-9b51ba9e8a6d852e67d1a07fdfd9cd9e233501bc.zip | |
simplify.
| -rw-r--r-- | lisp/emacs-lisp/regexp-opt.el | 18 |
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 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Simon Marshall <simon@gnu.ai.mit.edu> | 5 | ;; Author: Simon Marshall <simon@gnu.ai.mit.edu> |
| 6 | ;; Keywords: strings, regexps | 6 | ;; Keywords: strings, regexps |
| 7 | ;; Version: 1.05 | 7 | ;; Version: 1.05.01 |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | 10 | ||
| @@ -220,14 +220,14 @@ in REGEXP." | |||
| 220 | (aset charmap char t)))) | 220 | (aset charmap char t)))) |
| 221 | ;; | 221 | ;; |
| 222 | ;; Make a character set from the map using ranges where applicable. | 222 | ;; Make a character set from the map using ranges where applicable. |
| 223 | (dotimes (elt charwidth) | 223 | (dotimes (char charwidth) |
| 224 | (when (aref charmap elt) | 224 | (let ((start char)) |
| 225 | (let ((start elt)) | 225 | (while (and (< char charwidth) (aref charmap char)) |
| 226 | (while (and (< elt charwidth) (aref charmap elt)) | 226 | (incf char)) |
| 227 | (incf elt)) | 227 | (cond ((> char (+ start 3)) |
| 228 | (if (> (- elt start) 3) | 228 | (setq charset (format "%s%c-%c" charset start (1- char)))) |
| 229 | (setq charset (format "%s%c-%c" charset start (1- elt))) | 229 | ((> char start) |
| 230 | (setq charset (format "%s%c" charset (setq elt start))))))) | 230 | (setq charset (format "%s%c" charset (setq char start))))))) |
| 231 | ;; | 231 | ;; |
| 232 | ;; Make sure a caret is not first and a dash is first or last. | 232 | ;; Make sure a caret is not first and a dash is first or last. |
| 233 | (if (and (string-equal charset "") (string-equal bracket "")) | 233 | (if (and (string-equal charset "") (string-equal bracket "")) |