From 0b7104c6236c019112fa1b4a870589cb987df56a Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Mon, 10 Sep 2012 17:03:52 +0900 Subject: [PATCH] Assign new genres `journal-name@ruimoku', `publisher@ruimoku' and `publisher-name@ruimoku'. (www-feature-value-format): Use `space-separated' instead of `space-separated-char-list' for type `relation'; use `space-separated' as the default format. (est-format-object): Add new optional argument `readable'; if the optional argument `readable' is not nil, use feature-value of `name', `=name' or `title' as object representation format. --- cwiki-common.el | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cwiki-common.el b/cwiki-common.el index 3cc2da6..60a93a2 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -16,6 +16,9 @@ (concord-assign-genre 'era@ruimoku "/usr/local/var/ruimoku/db") (concord-assign-genre 'period@ruimoku "/usr/local/var/ruimoku/db") (concord-assign-genre 'journal@ruimoku "/usr/local/var/ruimoku/db") +(concord-assign-genre 'journal-name@ruimoku "/usr/local/var/ruimoku/db") +(concord-assign-genre 'publisher@ruimoku "/usr/local/var/ruimoku/db") +(concord-assign-genre 'publisher-name@ruimoku "/usr/local/var/ruimoku/db") (mount-char-attribute-table 'instance@ruimoku/bibliography/title) ;; (mount-char-attribute-table 'instance@ruimoku/bibliography/content*note) @@ -93,7 +96,7 @@ ret) (let ((type (www-feature-type feature-name))) (cond ((eq type 'relation) - 'space-separated-char-list) + 'space-separated) ((eq type 'structure) 'space-separated-ids) ((eq type 'stext) @@ -104,7 +107,8 @@ (= (charset-chars feature-name) 94)) '("0x" (HEX) " (" (decimal) ") <" (ku-ten) "> " (prev-char) (next-char)) - '("0x" (HEX) " (" (decimal) ") " (prev-char) (next-char)))))) + '("0x" (HEX) " (" (decimal) ") " (prev-char) (next-char)))) + 'space-separated)) (defun char-feature-name-at-domain (feature-name domain) (if domain @@ -462,10 +466,15 @@ )))) (format "rep.id:%s" (concord-object-id object)))) -(defun est-format-object (object) +(defun est-format-object (object &optional readable) (if (characterp object) (char-to-string object) - (format "%s" (concord-object-id object)))) + (let ((ret (or (if readable + (or (concord-object-get object 'name) + (concord-object-get object '=name) + (concord-object-get object 'title))) + (concord-object-id object)))) + (format "%s" ret)))) (defun www-uri-make-object-url (object &optional uri-object) (format "%s?%s=%s" -- 1.7.10.4