update.
[chise/est.git] / cwiki-view.el
1 ;; -*- coding: utf-8-mcs-er -*-
2 (require 'cwiki-format)
3 (require 'char-db-json)
4
5 (defvar chise-wiki-view-url "view.cgi")
6 (defvar chise-wiki-edit-url "edit.cgi")
7 (defvar chise-wiki-add-url "add.cgi")
8
9 (defun www-edit-display-feature-input-box (char feature-name
10                                                 &optional format value)
11   (if (symbolp char)
12       (setq char (or (concord-decode-object '=id char 'feature)
13                      (concord-make-object 'feature char))))
14   (unless format
15     (setq format 'default))
16   (unless value
17     (setq value (www-get-feature-value char feature-name)))
18   (if (and (symbolp value)
19            (eq format 'wiki-text))
20       (setq value (list (list value))))
21   (princ
22    (format "<p><input type=\"text\" name=\"feature-name\"
23 size=\"32\" maxlength=\"256\" value=\"%s\">"
24            feature-name))
25   (princ (encode-coding-string " \u2190 " 'utf-8-mcs-er))
26   (princ
27    (format "%s<input type=\"text\" name=\"%s\"
28 size=\"64\" maxlength=\"256\" value=\"%s\">
29 <input type=\"submit\" value=\"set\" /></p>
30 "
31            (if (or (eq format 'HEX)(eq format 'hex))
32                "0x"
33              "")
34            format
35            (mapconcat (lambda (c)
36                         (cond
37                          ;; ((eq c ?<) "&amp;lt;")
38                          ;; ((eq c ?>) "&amp;gt;")
39                          ((eq c ?\u0022) "&quot;")
40                          (t
41                           (char-to-string c))))
42                       (est-format-list value format nil nil " ")
43                       "")))
44   )
45
46 (defun www-display-object-desc (genre uri-object &optional uri-feature-name
47                                       lang level simple
48                                       uri-feature-name-to-edit editing-format)
49   (unless level
50     (setq level 0))
51   (let ((object (www-uri-decode-object genre uri-object))
52         (est-eval-list-feature-items-limit est-eval-list-feature-items-limit)
53         (est-view-url-prefix (if uri-feature-name
54                                  "../.."
55                                ".."))
56         (rdf-uri-object (if est-hide-cgi-mode
57                             (if (string-match "=" uri-object)
58                                 (concat
59                                  (est-uri-decode-feature-name-body
60                                   (substring uri-object 0 (match-beginning 0)))
61                                  ":"
62                                  (est-uri-decode-feature-name-body
63                                   (substring uri-object (match-end 0))))
64                               uri-object)))
65         feature-name-to-display feature-name-to-edit
66         base-name-to-edit metadata-name-to-edit
67         without-header
68         logical-feature chise-wiki-displayed-features
69         parents
70         GlyphWiki-id HNG-card ret object-spec)
71     (if (eq level 0)
72         (setq level 1
73               without-header nil)
74       (setq without-header t))
75     (when object
76       (when uri-feature-name-to-edit
77         (setq feature-name-to-edit
78               (www-uri-decode-feature-name uri-feature-name-to-edit))
79         (setq ret (symbol-name feature-name-to-edit))
80         (if (string-match "\\*" ret)
81             (setq base-name-to-edit (intern
82                                      (substring ret 0 (match-beginning 0)))
83                   metadata-name-to-edit (intern
84                                          (substring ret (match-end 0))))
85           (setq base-name-to-edit feature-name-to-edit))
86         (when (stringp editing-format)
87           (setq editing-format (intern editing-format))))
88       (when (and (eq genre 'character)
89                  (= (length uri-object) 1))
90         (setq uri-object (www-uri-encode-object object)))
91       (when (= level 1)
92         (princ
93          (encode-coding-string
94           (format "<head>
95 <style type=\"text/css\">
96 <!--
97 hr { color: green; }
98 .ids { vertical-align: middle; font-size: 40px; line-height: 100%%; }
99 a { text-decoration: none; }
100 .ids a { color: black; }
101 ul { margin: 0 0; color: black; }
102 li { margin: 0 0 0 2em; }
103 .feature-name { font-family: sans-serif; font-weight: bold; }
104 .feature-name a { color: black; }
105 -->
106 </style>
107
108 <title>EsT %s = %s</title>
109 </head>\n"
110                   genre
111                   (decode-uri-string uri-object 'utf-8-mcs-er))
112           'utf-8-mcs-er))
113         (princ "<body>\n"))
114       (when (eq genre 'character)
115         (dolist (feature (char-feature-property '$object 'additional-features))
116           (mount-char-attribute-table
117            (char-feature-name-at-domain feature '$rev=latest))))
118       (princ
119        (if simple
120            (format
121             (if est-hide-cgi-mode
122                 "<div style=\"text-align:right;\">
123 <a href=\"../../edit/view.cgi?%s=%s\">
124 <input type=\"submit\" value=\"Edit\" />
125 </a>\n"
126               "<div style=\"text-align:right;\">
127 <a href=\"edit/view.cgi?%s=%s\">
128 <input type=\"submit\" value=\"Edit\" />
129 </a>\n")
130             genre rdf-uri-object)
131          (format
132           "<div style=\"text-align:right;\">
133 <a href=\"../view/%s/%s\">
134 <input type=\"submit\" value=\"Simple\" />
135 </a>\n"
136           genre
137           (if (string-match ":" uri-object)
138               (concat
139                (est-uri-encode-feature-name-body
140                 (substring uri-object 0 (match-beginning 0)))
141                "="
142                (est-uri-encode-feature-name-body
143                 (substring uri-object (match-end 0))))))))
144       (princ
145        (format "<input type=\"submit\" value=\"New Account\" />
146 <a href=\"http://www.chise.org/est/rdf.cgi?%s=%s\">
147 <input type=\"submit\" value=\"RDF\" />
148 </a>%s
149 </div>
150 <hr />\n"
151                genre rdf-uri-object
152                (if (eq genre 'character)
153                    (format "
154 <a href=\"/est/view/%s/%s/data.json\">
155 <input type=\"submit\" value=\"JSON\" />
156 </a>\n"
157                            genre rdf-uri-object)
158                  "")))
159       (when (setq parents (www-get-feature-value object '<-denotational))
160         (princ (format "<p>%s %s</p>\n<hr>\n"
161                        (www-format-value-as-char-list parents)
162                        (www-format-feature-name '->denotational lang))))
163       (when (setq parents (www-get-feature-value object '<-subsumptive))
164         (princ (format "<p>%s %s</p>\n<hr>\n"
165                        (www-format-value-as-char-list parents)
166                        (www-format-feature-name '->subsumptive lang))))
167       (when (eq genre 'character)
168         (setq GlyphWiki-id (char-GlyphWiki-id object)))
169       (setq ret (www-format-encode-string
170                  (est-format-object object 'readable)))
171       (setq HNG-card
172             (if (string-match "<img alt=\"HNG\\([0-9]+\\)-\\([0-9]+\\)\"" ret)
173                 (format "HNG/%s/cards/%s.jpg"
174                         (match-string 1 ret)
175                         (match-string 2 ret))))
176       (princ (format "<h%d>%s%s</h%d>\n"
177                      level
178                      (if uri-feature-name
179                          (format "<a href=\"%s\">%s</a>"
180                                  ;; (if est-hide-cgi-mode
181                                  ;;     "<a href=\"../%s\">%s</a>"
182                                  ;;   "<a href=\"%s\">%s</a>")
183                                  (www-uri-make-object-url object uri-object)
184                                  ret)
185                        (if HNG-card
186                            (format
187                             "<a href=\"http://hng.chise.org/images/%s\">%s</a>"
188                             HNG-card ret)
189                          ret))
190                      (if GlyphWiki-id
191                          (format
192                           " <a href=\"http://glyphwiki.org/wiki/%s\"><img alt=\"%s\" src=\"http://glyphwiki.org/glyph/%s.50px.png\" /></a>"
193                           GlyphWiki-id
194                           GlyphWiki-id GlyphWiki-id)
195                        "")
196                      level))
197       (if (> level 1)
198           (princ "<ul>"))
199       (when feature-name-to-edit
200         (princ "<form action=\"set.cgi\" method=\"GET\">\n")
201         (princ
202          (encode-coding-string
203           (format "<p>(%s : <input type=\"text\" name=\"%s\"
204 size=\"30\" maxlength=\"30\" value=\"%s\">)</p>
205 "
206                   genre genre
207                   (decode-uri-string uri-object 'utf-8-mcs-er))
208           'utf-8-mcs-er)))
209       (setq object-spec
210             (cond
211              (uri-feature-name
212               (setq feature-name-to-display
213                     (www-uri-decode-feature-name uri-feature-name))
214               (setq est-eval-list-feature-items-limit nil)
215               (list
216                (cons feature-name-to-display
217                      (if (eq genre 'character)
218                          (get-char-attribute object feature-name-to-display)
219                        (concord-object-get object feature-name-to-display)))))
220              (t
221               (if (eq genre 'character)
222                   (char-attribute-alist object)
223                 (concord-object-spec object)))))
224       (when feature-name-to-edit
225         (unless (assq base-name-to-edit object-spec)
226           (setq object-spec (cons (cons base-name-to-edit nil)
227                                   object-spec))))
228       (dolist (cell (sort object-spec
229                           (lambda (a b)
230                             (char-attribute-name<
231                              (char-feature-name-sans-versions (car a))
232                              (char-feature-name-sans-versions (car b))))))
233         (setq logical-feature (char-feature-name-sans-versions (car cell)))
234         (unless (memq logical-feature chise-wiki-displayed-features)
235           (push logical-feature chise-wiki-displayed-features)
236           (cond
237            ((and feature-name-to-edit
238                  (eq (car cell) feature-name-to-edit))
239             (www-edit-display-feature-input-box
240              object feature-name-to-edit editing-format)
241             )
242            (t
243             (princ
244              (if (= level 1)
245                  "<div class=\"feature\" style=\"line-height:150%\">\n"
246                "<li>\n"))
247             (princ
248              (www-format-eval-list
249               (www-feature-format logical-feature)
250               object
251               logical-feature ; (car cell)
252               lang uri-object
253               nil simple))
254             (unless simple
255               (princ
256                (format " <a href=\"%s?%s=%s&feature=%s&format=wiki-text\"
257 ><input type=\"submit\" value=\"note\" /></a>"
258                        chise-wiki-edit-url
259                        genre
260                        (www-format-encode-string uri-object)
261                        (www-format-encode-string
262                         (www-uri-encode-feature-name
263                          (intern (format "%s*note"
264                                          logical-feature ; (car cell)
265                                          )))))))
266             (when (and feature-name-to-edit
267                        (eq base-name-to-edit (car cell)) metadata-name-to-edit)
268               (princ "<ul>\n")
269               (princ "<li>")
270               (www-edit-display-feature-input-box
271                object feature-name-to-edit editing-format)
272               (princ "</li>")
273               (princ "</ul>"))
274             (princ
275              (if (= level 1)
276                  "</div>\n"
277                "<li>\n"))
278             ))
279           ))
280       (princ
281        (if (= level 1)
282            "<p>\n"
283          "<li>\n"))
284       (when feature-name-to-edit
285         (princ "</form>\n"))
286       (unless simple
287         (princ
288          (format "<a href=\"%s?%s=%s\"
289 ><input type=\"submit\" value=\"add feature\" /></a>
290 "
291                  chise-wiki-add-url
292                  genre
293                  (www-format-encode-string uri-object))))
294       (princ
295        (if (= level 1)
296            "<p>\n"
297          "<li>\n"))
298       (when (eq genre 'character)
299         (princ
300          "<form action=\"http://www.chise.org/ids-find\">\n")
301         (princ
302          (www-format-encode-string
303           (est-format-object object)
304           ;; (if (eq genre 'character)
305           ;;     (format "%c" object)
306           ;;   (format "%s" (concord-object-id object)))
307           ))
308         (princ
309          (format
310           " <input type=\"text\" name=\"components\"
311 size=\"30\" maxlength=\"30\" value=\"%s\" />"
312           (encode-coding-string
313            (est-format-object object)
314            ;; (if (eq genre 'character)
315            ;;     (char-to-string object)
316            ;;   (format "%s" (concord-object-id object)))
317            'utf-8-jp-er)))
318         (princ
319          (www-format-encode-string
320           "を\u542Bむ\u6F22\u5B57を\u63A2す"))
321         (princ " <input type=\"submit\" value=\"search\" />\n")
322         (princ "</form>\n")
323
324         (princ
325          "<form action=\"http://www.chise.org/hng-ids-find\">\n")
326         (princ
327          (www-format-encode-string
328           (est-format-object object)
329           ;; (if (eq genre 'character)
330           ;;     (format "%c" object)
331           ;;   (format "%s" (concord-object-id object)))
332           ))
333         (princ
334          (format
335           " <input type=\"text\" name=\"components\"
336 size=\"30\" maxlength=\"30\" value=\"%s\" />"
337           (encode-coding-string
338            (est-format-object object)
339            ;; (if (eq genre 'character)
340            ;;     (char-to-string object)
341            ;;   (format "%s" (concord-object-id object)))
342            'utf-8-jp-er)))
343         (princ
344          (www-format-encode-string
345           "を\u542Bむ HNG の\u6F22\u5B57を\u63A2す"))
346         (princ " <input type=\"submit\" value=\"search\" />\n")
347         (princ "</form>\n")
348         )
349       (princ
350        (if (= level 1)
351            "</p>\n"
352          "<li>\n"))
353       )))
354
355 (defun www-display-feature-desc (uri-feature-name genre uri-object
356                                                   &optional lang simple)
357   (let ((rdf-uri-object (if est-hide-cgi-mode
358                             (if (string-match "=" uri-object)
359                                 (concat
360                                  (est-uri-decode-feature-name-body
361                                   (substring uri-object 0 (match-beginning 0)))
362                                  ":"
363                                  (est-uri-decode-feature-name-body
364                                   (substring uri-object (match-end 0))))
365                               uri-object)))
366         (feature-name (www-uri-decode-feature-name uri-feature-name))
367         (name@lang (intern (format "name@%s" lang))))
368     (princ
369      (encode-coding-string
370       (format "<head>
371 <title>EsT feature: %s</title>
372 </head>\n"
373               feature-name)
374       'utf-8-mcs-er))
375     (princ "<body>\n")
376     (princ
377      (if simple
378          (format
379           (if est-hide-cgi-mode
380               "<div style=\"text-align:right;\">
381 <a href=\"../../../edit/view.cgi?feature=%s&%s=%s\">
382 <input type=\"submit\" value=\"Edit\" />
383 </a>
384 <input type=\"submit\" value=\"New Account\" />
385 </div>
386 <hr />\n"
387             "<div style=\"text-align:right;\">
388 <a href=\"edit/view.cgi?feature=%s&%s=%s\">
389 <input type=\"submit\" value=\"Edit\" />
390 </a>
391 <input type=\"submit\" value=\"New Account\" />
392 </div>
393 <hr />\n")
394           uri-feature-name genre rdf-uri-object)
395        (format
396         "<div style=\"text-align:right;\">
397 <a href=\"../view/feature/%s&%s/%s\">
398 <input type=\"submit\" value=\"Simple\" />
399 </a>
400 </div>
401 <hr />\n"
402         uri-feature-name genre uri-object)))
403     (princ
404      (format "<h1>%s</h1>\n"
405              (www-format-encode-string
406               (symbol-name feature-name))))
407     (princ (format "<p>name : %s "
408                    (or (www-format-feature-name feature-name) "")))
409     (unless simple
410       (princ
411        (format
412         " <a href=\"%s?feature=%s&property=name&format=string&%s=%s\">"
413         chise-wiki-edit-url
414         uri-feature-name
415         genre
416         uri-object))
417       (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
418     (princ "</p>\n")
419     (when lang
420       (princ "<p>")
421       (princ
422        (www-format-encode-string
423         (format "%s : %s"
424                 name@lang
425                 (or (char-feature-property feature-name name@lang) ""))))
426       (unless simple
427         (princ
428          (format
429           " <a href=\"%s?feature=%s&property=%s&format=string&%s=%s\">"
430           chise-wiki-edit-url
431           uri-feature-name
432           name@lang
433           genre
434           uri-object))
435         (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
436       (princ "</p>\n"))
437     (www-html-display-paragraph
438      (format "type : %s"
439              (or (www-feature-type feature-name)
440                  ;; (char-feature-property feature-name 'type)
441                  'generic)))
442     (princ (format "<p>value-format : %s "
443                    (www-format-value
444                     nil 'value-format 
445                     (or (www-feature-value-format feature-name)
446                         'default)
447                     'default
448                     'without-tags)
449                    ))
450     (unless simple
451       (princ
452        (format
453         " <a href=\"%s?feature=%s&property=value-format&format=wiki-text&%s=%s\"
454 >"
455         chise-wiki-edit-url
456         uri-feature-name
457         genre
458         uri-object))
459       (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
460     (princ "</p>\n")
461
462     (princ (format "<p>value-presentation-format : %s "
463                    (www-format-value
464                     nil 'value-presentation-format 
465                     (or (www-feature-value-format feature-name)
466                         'default)
467                     'default
468                     'without-tags)
469                    ))
470     (unless simple
471       (princ
472        (format
473         " <a href=\"%s?feature=%s&property=value-presentation-format&format=wiki-text&%s=%s\"
474 >"
475         chise-wiki-edit-url
476         uri-feature-name
477         genre
478         uri-object))
479       (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
480     (princ "</p>\n")
481
482     (princ "<p>format : ")
483     (www-html-display-text
484      (decode-coding-string
485       (www-xml-format-list
486        (www-feature-format feature-name))
487       'utf-8-mcs-er))
488     (unless simple
489       (princ
490        (format
491         " <a href=\"%s?feature=%s&property=format&format=wiki-text&%s=%s\"
492 >"
493         chise-wiki-edit-url
494         uri-feature-name
495         genre
496         uri-object))
497       (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
498     (princ "</p>\n")
499     
500     (www-html-display-paragraph
501      (format "description : %s"
502              (or (decode-coding-string
503                   (char-feature-property feature-name 'description)
504                   'utf-8-mcs-er)
505                  "")))
506     (when lang
507       (www-html-display-paragraph
508        (format "description@%s : %s"
509                lang
510                (or (char-feature-property
511                     feature-name
512                     (intern (format "description@%s" lang)))
513                    ""))))
514     ))
515   
516 (defun www-batch-view ()
517   (setq terminal-coding-system 'binary)
518   (condition-case err
519       (let* ((target (pop command-line-args-left))
520              (user (pop command-line-args-left))
521              (accept-language (pop command-line-args-left))
522              (mode (intern (pop command-line-args-left)))
523              (lang
524               (intern
525                (car (split-string
526                      (car (split-string
527                            (car (split-string accept-language ","))
528                            ";"))
529                      "-"))))
530              ret genre)
531         (princ "Content-Type: text/html; charset=UTF-8
532
533 <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
534             \"http://www.w3.org/TR/html4/loose.dtd\">
535 <html lang=\"ja\">
536 ")
537         (cond
538          ((stringp target)
539           (when (string-match "^char=\\(&[^&;]+;\\)" target)
540             (setq ret (match-end 0))
541             (setq target
542                   (concat "char="
543                           (www-uri-encode-object
544                            (www-uri-decode-object
545                             'character (match-string 1 target)))
546                           (substring target ret))))
547           (setq target
548                 (mapcar (lambda (cell)
549                           (if (string-match "=" cell)
550                               (progn
551                                 (setq genre (substring cell 0 (match-beginning 0))
552                                       ret (substring cell (match-end 0)))
553                                 (cons
554                                  (intern
555                                   (decode-uri-string genre 'utf-8-mcs-er))
556                                  ret))
557                             (list (decode-uri-string cell 'utf-8-mcs-er))))
558                         (split-string target "&")))
559           (setq ret (car target))
560           (cond ((eq (car ret) 'char)
561                  (www-display-object-desc
562                   'character (cdr ret) (cdr (assq 'feature target))
563                   lang nil
564                   (eq mode 'simple))
565                  )
566                 ((eq (car ret) 'feature)
567                  (www-display-feature-desc
568                   (decode-uri-string (cdr ret) 'utf-8-mcs-er)
569                   (car (nth 1 target))
570                   (cdr (nth 1 target))
571                   lang
572                   (eq mode 'simple))
573                  )
574                 (t
575                  (www-display-object-desc
576                   (car ret) (cdr ret) (cdr (assq 'feature target))
577                   lang nil
578                   (eq mode 'simple))
579                  ))
580           ))
581         (princ "\n<hr>\n")
582         (princ (format "mode=%S\n" mode))
583         (princ (format "user=%s\n" user))
584         ;; (princ (format "local user=%s\n" (user-login-name)))
585         (princ (format "lang=%S\n" lang))
586         (princ (encode-coding-string (emacs-version) 'utf-8-jp-er))
587         ;; (princ " CHISE ")
588         ;; (princ xemacs-chise-version)
589         (princ "
590 </body>
591 </html>")
592         )
593     (error nil
594            (princ (format "%S" err)))
595     ))
596
597 (defun www-batch-view-smart ()
598   (setq debug-on-error t)
599   (setq terminal-coding-system 'binary)
600   (condition-case err
601       (let* ((est-hide-cgi-mode t)
602              (target (pop command-line-args-left))
603              (user (pop command-line-args-left))
604              (accept-language (pop command-line-args-left))
605              (mode (intern (pop command-line-args-left)))
606              (lang
607               (intern
608                (car (split-string
609                      (car (split-string
610                            (car (split-string accept-language ","))
611                            ";"))
612                      "-"))))
613              ret genre feature json obj)
614         (cond
615          ((stringp target)
616           (when (string-match "/data\\.json$" target)
617             (setq json t
618                   target (substring target 0 (match-beginning 0))))
619           (when (string-match "^char/\\(&[^&;]+;\\)" target)
620             (setq ret (match-end 0))
621             (setq target
622                   (concat "char/"
623                           (www-uri-encode-object
624                            (www-uri-decode-object
625                             'character (match-string 1 target)))
626                           (substring target ret))))
627           (setq target
628                 (mapcar
629                  (lambda (cell)
630                    (if (string-match "/" cell)
631                        (progn
632                          (setq genre (substring cell 0 (match-beginning 0))
633                                ret (substring cell (match-end 0)))
634                          (cons
635                           (intern (decode-uri-string genre 'utf-8-mcs-er))
636                           (if (string-match "/feature=" ret)
637                               (list (substring ret 0 (match-beginning 0))
638                                     (substring ret (match-end 0)))
639                             (list ret))))
640                      (list (decode-uri-string cell 'utf-8-mcs-er)))
641                    ;; (setq ret (split-string cell "/"))
642                    ;; (cons (intern
643                    ;;        (decode-uri-string (car ret) 'utf-8-mcs-er))
644                    ;;       (cdr ret))
645                    )
646                  (split-string target "&")))
647           (setq ret (car target))
648           (if json
649               (princ "Content-Type: application/json; charset=UTF-8
650
651 ")
652             (princ "Content-Type: text/html; charset=UTF-8
653
654 <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
655             \"http://www.w3.org/TR/html4/loose.dtd\">
656 <html lang=\"ja\">
657 ")
658             )
659           ;; (princ (format "<p>%S, %S, %S</p>"
660           ;;                (car ret)(nth 1 ret)(nth 2 ret)))
661           ;; (princ (format "// %S %S\n" ret json))
662           (cond ((or (eq (car ret) 'char)
663                      (eq (car ret) 'character))
664                  (if (and json
665                           (setq obj (www-uri-decode-object
666                                      (car ret)(nth 1 ret)))
667                           (characterp obj))
668                      (with-temp-buffer
669                        ;; (princ (encode-coding-string
670                        ;;         (format "// %S\n" obj)
671                        ;;         char-db-file-coding-system))
672                        (char-db-json-char-data-with-variant obj 'printable)
673                        (encode-coding-region
674                         (point-min)(point-max)
675                         char-db-file-coding-system)
676                        (princ (buffer-string))
677                        )
678                    (www-display-object-desc
679                     'character (nth 1 ret) (nth 2 ret)
680                     lang nil
681                     (eq mode 'simple)))
682                  )
683                 ((eq (car ret) 'feature)
684                  (www-display-feature-desc
685                   (decode-uri-string (nth 1 ret) 'utf-8-mcs-er)
686                   (car (nth 1 target))
687                   (nth 1 (nth 1 target))
688                   lang
689                   (eq mode 'simple))
690                  )
691                 (t
692                  (www-display-object-desc
693                   (car ret) (nth 1 ret) (nth 2 ret)
694                   lang nil
695                   (eq mode 'simple))
696                  ))
697           ))
698         (unless json
699           (princ "\n<hr>\n")
700           (princ (format "mode=%S\n" mode))
701           (princ (format "user=%s\n" user))
702           ;; (princ (format "local user=%s\n" (user-login-name)))
703           (princ (format "lang=%S\n" lang))
704           (princ (encode-coding-string (emacs-version) 'utf-8-jp-er))
705           ;; (princ " CHISE ")
706           ;; (princ xemacs-chise-version)
707           (princ "
708 </body>
709 </html>")
710           )
711         )
712     (error nil
713            (princ (format "%S" err)))
714     ))
715
716 (provide 'cwiki-view)