From: MORIOKA Tomohiko Date: Sat, 22 Sep 2012 06:06:58 +0000 (+0900) Subject: (est-eval-value-as-journal-volume): Add new optional argument `short'. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=26fd74ac7468cc847006a0ff0509198b78b4d756;p=chise%2Fest.git (est-eval-value-as-journal-volume): Add new optional argument `short'. (est-eval-value-as-journal-volumes): New function. (est-eval-apply-value): Use `est-eval-value-as-journal-volumes' for format `journal-volume-list'. (est-eval-feature-value): Change limit size from 127 to 255. --- diff --git a/est-eval.el b/est-eval.el index ab734df..fb850d1 100644 --- a/est-eval.el +++ b/est-eval.el @@ -103,7 +103,7 @@ ;; (t nil) ;; )) -(defun est-eval-value-as-journal-volume (value) +(defun est-eval-value-as-journal-volume (value &optional short) (let ((journal (car (or (concord-object-get value '<-journal/volume) (concord-object-get value '<-volume)))) (vol-name (concord-object-get value '<-journal/volume*name)) @@ -137,9 +137,10 @@ (concord-object-get value '<-volume*number)) year 'cjk)))) ) - (if (setq ret (est-eval-value-as-object journal)) - (setq dest - (list* ret " " dest))) + (unless short + (if (setq ret (est-eval-value-as-object journal)) + (setq dest + (list* ret " " dest)))) (list* 'list '(:subtype sequence :separator "") dest) ) ((setq title (concord-object-get value 'title)) @@ -369,7 +370,7 @@ (defun est-eval-value-as-object-list (value &optional separator subtype) (if (and (listp value) (listp (cdr value))) - (condition-case err + (condition-case nil (let (props) (if separator (setq props (list :separator separator))) @@ -377,7 +378,7 @@ (setq props (list* :subtype subtype props))) (list* 'list props (mapcar #'est-eval-value-as-object value))) - (error err (format "%s" value))) + (error (format "%s" value))) (format "%s" value))) (defun est-eval-value-as-ids (value) @@ -530,6 +531,19 @@ value)) (est-eval-value-default value))) +(defun est-eval-value-as-journal-volumes (value &optional subtype) + (if (listp value) + (list* 'journal-volumes + (if subtype + '(:subtype unordered-list) + '(:separator " ")) + (mapcar (lambda (volume) + (if (concord-object-p volume) + (est-eval-value-as-journal-volume volume 'short) + volume)) + value)) + (est-eval-value-default value))) + ;;; @ format evaluator ;;; @@ -617,6 +631,8 @@ (est-eval-value-as-created-works value)) ((eq format 'unordered-created-work-list) (est-eval-value-as-created-works value 'unordered-list)) + ((eq format 'journal-volume-list) + (est-eval-value-as-journal-volumes value)) (t (est-eval-value-default value) )) @@ -630,7 +646,7 @@ (setq format (www-feature-value-format feature-name))) (if (consp value) (let ((ret (condition-case nil - (nthcdr 127 value) + (nthcdr 255 value) (error nil nil)))) (when ret (setcdr ret