From b5cea31969623efeaa232f098fecdaf3da42c98a Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 2 Sep 1998 14:34:20 +0000 Subject: [PATCH] * ew-data.el (ew-search-sticked-eword): New function. (ew-separate-eword): Use `ew-search-sticked-eword' to check `ew-permit-null-encoded-text', `ew-ignore-75bytes-limit', `ew-permit-sticked-comment' and `ew-permit-sticked-special'. --- ChangeLog | 7 +++++++ ew-data.el | 44 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8bc893e..b1ca2fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 1998-09-02 Tanaka Akira + * ew-data.el (ew-search-sticked-eword): New function. + (ew-separate-eword): Use `ew-search-sticked-eword' to + check `ew-permit-null-encoded-text', `ew-ignore-75bytes-limit', + `ew-permit-sticked-comment' and `ew-permit-sticked-special'. + +1998-09-02 Tanaka Akira + * ew-data.el (ew-separate-eword): Remove `ew-permit-null-encoded-text' checking. diff --git a/ew-data.el b/ew-data.el index 436b014..962c455 100644 --- a/ew-data.el +++ b/ew-data.el @@ -56,21 +56,47 @@ frag)) (ew-frag-list anchor))) +(defun ew-search-sticked-eword (frag start) + (let* ((texts (symbol-name frag)) (len (length texts))) + (catch 'return + (while (string-match ew-encoded-word-regexp texts start) + (when (and (or ew-permit-null-encoded-text + (< (match-beginning 3) (match-end 3))) + (or ew-ignore-75bytes-limit + (<= (- (match-end 0) (match-beginning 0)) 75)) + (or ew-permit-sticked-comment + (not (= (match-beginning 0) 0)) + (not (ew-comment-frag-p (get frag 'prev-frag)))) + (or ew-permit-sticked-comment + (not (= (match-end 0) (length texts))) + (not (ew-comment-frag-p (get frag 'next-frag)))) + (or ew-permit-sticked-special + (not (= (match-beginning 0) 0)) + (ew-comment-frag-p (get frag 'prev-frag)) + (not (ew-special-frag-p (get frag 'prev-frag)))) + (or ew-permit-sticked-special + (not (= (match-end 0) (length texts))) + (ew-comment-frag-p (get frag 'next-frag)) + (not (ew-special-frag-p (get frag 'next-frag)))) + ) + (throw 'return t)) + (setq start (1- (match-end 0)))) + nil))) + (defun ew-separate-eword (frag1 frag2 targets) (while (not (eq frag1 frag2)) (when (and (memq (get frag1 'type) targets) - (string-match ew-encoded-word-regexp - (symbol-name frag1)) + (ew-search-sticked-eword frag1 0) (or (< 0 (match-beginning 0)) (< (match-end 0) (length (symbol-name frag1))))) - (let ((atom (symbol-name frag1)) + (let ((texts (symbol-name frag1)) (start (match-end 0)) result frag) (when (< 0 (match-beginning 0)) - (setq frag (make-symbol (substring atom 0 (match-beginning 0))) + (setq frag (make-symbol (substring texts 0 (match-beginning 0))) result (ew-rcons* result frag))) - (setq frag (make-symbol (substring atom (match-beginning 0) (match-end 0))) + (setq frag (make-symbol (substring texts (match-beginning 0) (match-end 0))) result (ew-rcons* result frag)) (when (cdr result) (put frag 'prev-frag (cadr result)) @@ -78,19 +104,19 @@ (setq frag (cadr result))) (put frag 'prev-frag (get frag1 'prev-frag)) (put (get frag1 'prev-frag) 'next-frag frag) - (while (string-match ew-encoded-word-regexp atom start) + (while (ew-search-sticked-eword frag1 start) (when (< start (match-beginning 0)) - (setq frag (make-symbol (substring atom start (match-beginning 0))) + (setq frag (make-symbol (substring texts start (match-beginning 0))) result (ew-rcons* result frag)) (put frag 'prev-frag (cadr result)) (put (cadr result) 'next-frag frag)) - (setq frag (make-symbol (substring atom (match-beginning 0) (match-end 0))) + (setq frag (make-symbol (substring texts (match-beginning 0) (match-end 0))) result (ew-rcons* result frag) start (match-end 0)) (put frag 'prev-frag (cadr result)) (put (cadr result) 'next-frag frag)) (when (< start (length (symbol-name frag1))) - (setq frag (make-symbol (substring atom start)) + (setq frag (make-symbol (substring texts start)) result (ew-rcons* result frag)) (put frag 'prev-frag (cadr result)) (put (cadr result) 'next-frag frag)) -- 1.7.10.4