From: MORIOKA Tomohiko Date: Fri, 3 Jun 2011 00:50:41 +0000 (+0900) Subject: (est-eval-value-default): Support `omitted' tag. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4ebdfbe53336a396de69d79377076c8ab78d172;p=chise%2Fest.git (est-eval-value-default): Support `omitted' tag. (est-eval-feature-value): Use `omitted' tag when length of value is more than 128. (est-eval-unit): Support `omitted' tag. --- diff --git a/est-eval.el b/est-eval.el index 91b91f2..7bf4482 100644 --- a/est-eval.el +++ b/est-eval.el @@ -9,12 +9,14 @@ (defun est-eval-value-default (value) (if (listp value) - (list* 'list - '(:separator " ") - (mapcar - (lambda (unit) - (format "%S" unit)) - value)) + (if (eq (car value) 'omitted) + value + (list* 'list + '(:separator " ") + (mapcar + (lambda (unit) + (format "%S" unit)) + value))) (est-eval-value-as-S-exp value))) (defun est-eval-value-as-object (value) @@ -275,6 +277,15 @@ (setq value (www-get-feature-value object feature-name))) (unless format (setq format (www-feature-value-format feature-name))) + (if (consp value) + (let ((ret (condition-case nil + (nthcdr 127 value) + (error nil nil)))) + (when ret + (setcdr ret + (list (list 'omitted + (list :object object :feature feature-name) + "...")))))) (cond ((symbolp format) (est-eval-apply-value object feature-name @@ -369,6 +380,11 @@ (format "@%s" domain) "")) ) + ((eq (car exp) 'omitted) + (list 'omitted + (list :object object :feature feature-name) + "...") + ) ((eq (car exp) 'prev-char) (list 'prev-char (list :object object :feature feature-name)