From: tomo Date: Mon, 26 Aug 2002 15:45:11 +0000 (+0000) Subject: (std11-non-atom-regexp): New constant. X-Git-Tag: flim-1_14_5~22 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=8a3c3c3ac014e346a0412902518a9accbb081a93;p=elisp%2Fflim.git (std11-non-atom-regexp): New constant. (std11-analyze-atom): New implementation to avoid error in current XEmacs UTF-2000 [may be caused by a bug about regexp]. --- diff --git a/std11.el b/std11.el index 97f9359..4067951 100644 --- a/std11.el +++ b/std11.el @@ -289,6 +289,11 @@ be the result." ) ;; (defconst std11-spaces-regexp ;; (eval-when-compile (concat "[" std11-space-char-list "]+"))) + +(defconst std11-non-atom-regexp + (eval-when-compile + (concat "[" std11-special-char-list std11-space-char-list "]"))) + (defconst std11-atom-regexp (eval-when-compile (concat "[^" std11-special-char-list std11-space-char-list "]+"))) @@ -313,13 +318,21 @@ be the result." )) (defun std11-analyze-atom (string start) - (if (and (string-match std11-atom-regexp string start) - (= (match-beginning 0) start)) - (let ((end (match-end 0))) - (cons (cons 'atom (substring string start end)) - ;;(substring string end) - end) - ))) + (if (string-match std11-non-atom-regexp string start) + (if (> (match-beginning 0) start) + (cons (cons 'atom (substring string start (match-beginning 0))) + (match-beginning 0)) + nil) + (cons (cons 'atom (substring string start)) + (length string))) + ;; (if (and (string-match std11-atom-regexp string start) + ;; (= (match-beginning 0) start)) + ;; (let ((end (match-end 0))) + ;; (cons (cons 'atom (substring string start end)) + ;; ;;(substring string end) + ;; end) + ;; )) + ) (defun std11-check-enclosure (string open close &optional recursive from) (let ((len (length string))