From: MORIOKA Tomohiko Date: Thu, 14 Oct 2010 02:18:53 +0000 (+0900) Subject: - Set `file-name-coding-system' to 'utf-8-mcs-er. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa27b98f56f3dab0ae75fbacec4811f98016e658;p=chise%2Fest.git - Set `file-name-coding-system' to 'utf-8-mcs-er. - Add settings to assign genres of Ruimoku. (www-get-feature-value): Modify for non-character genres. (www-uri-decode-object): Use `www-uri-decode-feature-name' for objects of `feature' genre. --- diff --git a/cwiki-common.el b/cwiki-common.el index aa35fd6..2a54841 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -1,6 +1,14 @@ ;; -*- coding: utf-8-mcs-er -*- (require 'char-db-util) +(setq file-name-coding-system 'utf-8-mcs-er) + +(concord-assign-genre 'creator "/usr/local/var/ruimoku/db") +(concord-assign-genre 'bibliography "/usr/local/var/ruimoku/db") +(concord-assign-genre 'era "/usr/local/var/ruimoku/db") +(concord-assign-genre 'period "/usr/local/var/ruimoku/db") +(concord-assign-genre 'journal "/usr/local/var/ruimoku/db") + (defvar chise-wiki-view-url "view.cgi") (defvar chise-wiki-edit-url "edit.cgi") @@ -120,10 +128,18 @@ feature))) (defun www-get-feature-value (object feature) - (let ((latest-feature (char-feature-name-at-domain feature '$rev=latest))) - (mount-char-attribute-table latest-feature) - (or (char-feature object latest-feature) - (char-feature object feature)))) + (let ((genre (www-get-genre object)) + (latest-feature (char-feature-name-at-domain feature '$rev=latest))) + (cond + ((eq genre 'character) + (mount-char-attribute-table latest-feature) + (or (char-feature object latest-feature) + (char-feature object feature)) + ) + (t + (or (concord-object-get object latest-feature) + (concord-object-get object feature)) + )))) (defun get-previous-code-point (ccs code) (let ((chars (charset-chars ccs)) @@ -362,10 +378,19 @@ ) (t (setq char-rep (decode-uri-string char-rep 'utf-8-mcs-er)) - (if (eq genre 'character) - (when (= (length char-rep) 1) - (aref char-rep 0)) - (concord-decode-object '=id char-rep genre)))))) + (cond + ((eq genre 'character) + (when (= (length char-rep) 1) + (aref char-rep 0)) + ) + ((eq genre 'feature) + (concord-decode-object + '=id (www-uri-decode-feature-name char-rep) 'feature) + ) + (t + (concord-decode-object + '=id (car (read-from-string char-rep)) genre) + )))))) (defun www-uri-encode-char (char) (if (encode-char char '=ucs)