From: MORIOKA Tomohiko Date: Wed, 15 Jun 2016 00:36:21 +0000 (+0900) Subject: (est-eval-value-as-character): New function. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b2adc2d3e6b0150920d5f2961d0f663e1076339e;p=chise%2Fest.git (est-eval-value-as-character): New function. (est-eval-value-as-char-list): New function. (est-eval-apply-value): Add new format `char-list'. --- diff --git a/est-eval.el b/est-eval.el index 3f47739..3cd848a 100644 --- a/est-eval.el +++ b/est-eval.el @@ -358,6 +358,14 @@ ))) (est-eval-value-default value))) +(defun est-eval-value-as-character (value) + (let (ret) + (if (and (concord-object-p value) + (setq ret (concord-object-get value 'character))) + (list 'object (list :object value) + (mapconcat #'char-to-string ret "")) + (est-eval-value-as-object value)))) + (defun est-eval-value-as-HEX (value) (if (integerp value) (list 'HEX nil (format "%X" value)) @@ -395,6 +403,20 @@ (error (format "%s" value))) (format "%s" value))) +(defun est-eval-value-as-char-list (value &optional separator subtype) + (if (and (listp value) + (listp (cdr value))) + (condition-case nil + (let (props) + (if separator + (setq props (list :separator separator))) + (if subtype + (setq props (list* :subtype subtype props))) + (list* 'list props + (mapcar #'est-eval-value-as-character value))) + (error (format "%s" value))) + (format "%s" value))) + (defun est-eval-value-as-composition-list (value &optional separator subtype) (if (and (listp value) (listp (cdr value))) @@ -687,6 +709,8 @@ ((or (eq format 'space-separated) (eq format 'space-separated-char-list)) (est-eval-value-as-object-list value " ")) + ((eq format 'char-list) + (est-eval-value-as-char-list value nil)) ((eq format 'unordered-list) (est-eval-value-as-object-list value nil 'unordered-list)) ((eq format 'unordered-composition-list)