\documentclass[a4j]{jarticle}

\title{XEmacs UTF-2000 API}
\author{$B<i2,(B $BCNI'(B}
\date{}

\newenvironment{feature}[1]
{\vspace{0.3em}\noindent{\textbf{$B5!G=(B #1}}\vspace{-0.5em}\begin{quote}}
{\end{quote}}

\newenvironment{function}[2]
{\vspace{0.3em}\noindent{\textbf{$B4X?t(B #1} (\textit{#2})}\vspace{-0.5em}\begin{quote}}
{\end{quote}}

\newenvironment{example}
{\begin{description}\item [$B!NNc!O(B]}
{\end{description}}

\newcommand{\optargs}[1]{{\sl\textbf{\&optional}} #1}

\newcommand{\var}[1]{\textit{#1}}

\newcommand{\sym}[1]{\textsf{#1}}

\newcommand{\func}[1]{\sym{#1}}

\begin{document}

\maketitle

\begin{feature}{utf-2000}
  UTF-2000 $B5!G=$rDs6!$9$k!#(B

  \begin{example}
    (featurep 'utf-2000)
    $B"*(B t
  \end{example}
\end{feature}

\begin{function}{define-char}{char-spec}
  $BJ8;zB0@-$N=89g(B \var{char-spec} $B$GI=8=$5$l$kJ8;z%*%V%8%'%/%H$rDj5A$7!"(B
  $B$=$NJ8;z%*%V%8%'%/%H$rJV$9!#(B

  $BJ8;zB0@-$N=89g(B \var{char-spec} $B$OO"A[%j%9%H$G$"$k!#(B

  \begin{example}
\begin{verbatim}
(define-char
  '((name               . "CJK RADICAL SECOND TWO")
    (general-category   symbol other) ; Informative Category
    (bidi-category      . "ON")
    (mirrored           . nil)
    (total-strokes       . 1)
    (<-radical
     ((ucs                . #x4E5A)
      ))
    (ideograph-cdp      . -21)
    (chinese-big5-cdp   . #x8C5D)
    (ucs                . #x2E83)
    ))
\end{verbatim}
    %% $B$3$NNc!"(Bline by line $B$N@bL@$,$[$7$$!#(B
  \end{example}
\end{function}

\begin{function}{get-char-attribute}
        {character attribute \optargs{default-value}}
  $BJ8;z%*%V%8%'%/%H(B \var{character} $B$NB0@-(B \var{attribute} $B$N(B
  $BCM$rJV$9!#(B

  Return \var{default-value} if the value is not exist.

  \begin{example}
\begin{verbatim}
(get-char-attribute ?$B$"(B 'name)
$B"*(B "HIRAGANA LETTER A"
\end{verbatim}
    \end{example}
    %% $B>e$HF1$8Nc$r;H$&$[$&$,?F@Z$+$b!#!V$"!W$C$F8+$?$3$H$J$$?M$K$bFI(B
    %% $B$^$;$k$J$i!#(B
\end{function}

\begin{function}{put-char-attribute}{character attribute value}
  $BJ8;z%*%V%8%'%/%H(B \var{character} $B$NB0@-(B \var{attribute} $B$N(B
  $BCM$r(B \var{value} $B$K@_Dj$9$k!#(B

  \begin{example}
\begin{verbatim}
(get-char-attribute ?$B$"(B 'foo)
$B"*(Bnil
(put-char-attribute ?$B$"(B 'foo 1)
$B"*(B1
(get-char attribute ?$B$"(B 'foo)
$B"*(B1
\end{verbatim}
  \end{example}
\end{function}

\begin{function}{find-char}{attributes}
  In order to find a character object by a character \var{attribute},
    a builtin function \func{find-char} may be convenient.  This
    function retrieves the character that has specified attributes.
\end{function}

\begin{function}{map-char-attribute}{function attribute \optargs{range}}
    A map function for character attributes is also available.  This
    function is useful in finding characters with a character
    attribute, or processing by a character attribute,
  
    This function maps \var{function} over entries in \var{attribute},
    %% $B0J2<$O(Battribute ((key value) $B$N%j%9%H(B)$B$NA4MWAG$KBP$7$F(B  function
    %% (key value) $B$r8F$V!#$G$$$$$N!)(B
    %% What's table? 
    calling it with two arguments, each key and value in the table.

    \var{Range}
    specifies a subrange to map over and 
    %% $B0lHL$NFI<T$O(B XEmacsLisp $B$OCN$i$J$$!#(B
    is in the same format as the
    range argument to 
    'put-range-table'.  If omitted or t, it defaults to
    the entire table.  See Fig~\ref{fig:map-char-attribute}
    %%mapcaratributes?
    for an example using this function.    
\end{function}

\begin{function}{char-attribute-alist}{character}
  You can get every attributes of a character as an association-list
  by a built-in function \var{char-attribute-alist}.
  
  This function returns the alist of attributes of \var{character}.
\end{function}

\begin{function}{char-attribute-list}{}
    You can get the list of character attributes by a builtin function
    \func{char-attribute-list}.
    
    This function returns the list of all existing character
    attributes.
\end{function}

\begin{function}{encode-char}{character coded-charset \optargs{defined-only}}
  Return code-point of \var{character} in specified \var{coded-charset}.
\end{function}

\begin{function}{decode-char}{coded-charset code \optargs{defined-only}}
  Make a character from \var{coded-charset} and code-point \var{code}.

  If \var{defined-only} is non-\sym{nil}, builtin character is not returned.
  If corresponding character is not found, \sym{nil} is returned.
\end{function}

\begin{function}{decode-builtin-char}{coded-charset code}
  Make a builtin character from \var{coded-charset} and code-point \var{code}.
\end{function}

\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
