simplify.
This commit is contained in:
parent
b14fbaa008
commit
9b51ba9e8a
1 changed files with 9 additions and 9 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
;; Author: Simon Marshall <simon@gnu.ai.mit.edu>
|
;; Author: Simon Marshall <simon@gnu.ai.mit.edu>
|
||||||
;; Keywords: strings, regexps
|
;; Keywords: strings, regexps
|
||||||
;; Version: 1.05
|
;; Version: 1.05.01
|
||||||
|
|
||||||
;; This file is part of GNU Emacs.
|
;; This file is part of GNU Emacs.
|
||||||
|
|
||||||
|
@ -220,14 +220,14 @@ in REGEXP."
|
||||||
(aset charmap char t))))
|
(aset charmap char t))))
|
||||||
;;
|
;;
|
||||||
;; Make a character set from the map using ranges where applicable.
|
;; Make a character set from the map using ranges where applicable.
|
||||||
(dotimes (elt charwidth)
|
(dotimes (char charwidth)
|
||||||
(when (aref charmap elt)
|
(let ((start char))
|
||||||
(let ((start elt))
|
(while (and (< char charwidth) (aref charmap char))
|
||||||
(while (and (< elt charwidth) (aref charmap elt))
|
(incf char))
|
||||||
(incf elt))
|
(cond ((> char (+ start 3))
|
||||||
(if (> (- elt start) 3)
|
(setq charset (format "%s%c-%c" charset start (1- char))))
|
||||||
(setq charset (format "%s%c-%c" charset start (1- elt)))
|
((> char start)
|
||||||
(setq charset (format "%s%c" charset (setq elt start)))))))
|
(setq charset (format "%s%c" charset (setq char start)))))))
|
||||||
;;
|
;;
|
||||||
;; Make sure a caret is not first and a dash is first or last.
|
;; Make sure a caret is not first and a dash is first or last.
|
||||||
(if (and (string-equal charset "") (string-equal bracket ""))
|
(if (and (string-equal charset "") (string-equal bracket ""))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue