emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: char-table-range


From: Luc Teirlinck
Subject: Re: char-table-range
Date: Tue, 2 Mar 2004 21:39:19 -0600 (CST)

Ken 'ichi Handa wrote:

   (set-char-table-default TABLE IDX VAL)

     (1) If IDX is a symbol `ascii', set the default value for all
         characters to VAL.

     (2) If IDX is GENERIC-CHAR, set the value for characters in
         GENERIC-CHAR to nil, and set the default value for them to VAL.

     (3) If IDX is an individual character, set IDX to a generic
         character that represents the smallest group of characters
         containing IDX, and perform (2).

   I think (1) is a misfeature.  The default value for all characters
   should be set by specifying IDX nil.  (3) is also very questionable. I
   think we don't need it.

I do not know whether (2) is intended as description of the current
behavior of set-char-table-default or as a proposed new behavior.  As
a description of the current behavior it is not completely accurate.
Indeed, aset and set-char-table-range both behave exactly as described
in (2) for a generic character, but currently, set-char-table-default
for a generic character just sets the default value to VAL, _without_
first setting the value for characters in GENERIC-CHAR to nil (as aset
and set-char-table-range indeed both do).  See the ielm run below.

===File ~/chartable-stuff===================================
*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (setq cc (make-char-table 'translation-table))
ELISP> (aset cc (make-char 'ipa 48) 2)
2
ELISP> (aset cc (make-char 'ipa) 1)
1
ELISP> (aref cc (make-char 'ipa 48))
1
ELISP> (aset cc (make-char 'ipa 48) 2)
2
ELISP> (set-char-table-range cc (make-char 'ipa) 1)
1
ELISP> (aref cc (make-char 'ipa 48))
1
ELISP> (aset cc (make-char 'ipa 48) 2)
2
ELISP> (set-char-table-default cc (make-char 'ipa) 1)
1
ELISP> (aref cc (make-char 'ipa 48))
2
ELISP> 
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]