unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* set-char-table-range with charset arguments
@ 2003-12-11  2:13 Luc Teirlinck
  2003-12-11  2:52 ` Kenichi Handa
  0 siblings, 1 reply; 4+ messages in thread
From: Luc Teirlinck @ 2003-12-11  2:13 UTC (permalink / raw)


There are several mistakes and omissions in `(elisp)Char-Tables',
which I am trying to correct.  However, there are things I quite
simply do not understand and which do not seem to be documented
anywhere.  For instance, in the ielm run below, ascii seems to get
treated as completely _synonymous_ with 128.  Setting the entire ascii
range seems to affect 128 and no other character.  Similar things
happen with eight-bit-graphic (synonymous with 256) and
eight-bit-control.

The ielm run below first shows the expected behavior for the character
set ipa to show the contrast with the strange behavior for ascii.

Is that behavior a bug or does it serve some purpose?  If the latter,
where is that purpose documented?  (What is the value stored in 128
used for and where is it explained what it is used for?)  Maybe
set-char-table-range was never designed to work with the three
character sets without generic characters, but in that case, should it
not throw an error instead of doing cryptic stuff?

===File ~/ascii-ielm========================================
*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (put 'five-slots 'char-table-extra-slots 5)
5
ELISP> (setq cc (make-char-table 'five-slots))
;; Long output omitted.
ELISP> (make-char 'ipa)
6272
ELISP> (set-char-table-range cc 'ipa "ipa")
"ipa"
ELISP> (aref cc 6272)
"ipa"
ELISP> (aref cc 6300)
"ipa"
ELISP> (aset cc 6272 1001)
1001
ELISP> (aref cc 6300)
1001
ELISP> (set-char-table-range cc 'ascii 1)
1
ELISP> (make-char 'ascii)
0
ELISP> (aref cc 0)
nil
ELISP> (aref cc 32)
nil
ELISP> (aref cc 128)
1
ELISP> (aref cc 129)
nil
ELISP> (char-table-range cc 'ascii)
1
ELISP> (aset cc 128 10)
10
ELISP> (char-table-range cc 'ascii)
10
ELISP> (char-valid-p 128)
t
ELISP> (char-valid-p 6272)
nil
ELISP> 
============================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: set-char-table-range with charset arguments
  2003-12-11  2:13 set-char-table-range with charset arguments Luc Teirlinck
@ 2003-12-11  2:52 ` Kenichi Handa
  2003-12-11  3:17   ` Luc Teirlinck
  0 siblings, 1 reply; 4+ messages in thread
From: Kenichi Handa @ 2003-12-11  2:52 UTC (permalink / raw)
  Cc: emacs-devel

In article <200312110213.hBB2DsO28953@raven.dms.auburn.edu>, Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> There are several mistakes and omissions in `(elisp)Char-Tables',
> which I am trying to correct.  However, there are things I quite
> simply do not understand and which do not seem to be documented
> anywhere.  For instance, in the ielm run below, ascii seems to get
> treated as completely _synonymous_ with 128.  Setting the entire ascii
> range seems to affect 128 and no other character.  Similar things
> happen with eight-bit-graphic (synonymous with 256) and
> eight-bit-control.

> The ielm run below first shows the expected behavior for the character
> set ipa to show the contrast with the strange behavior for ascii.

> Is that behavior a bug or does it serve some purpose?  If the latter,
> where is that purpose documented?  (What is the value stored in 128
> used for and where is it explained what it is used for?)  Maybe
> set-char-table-range was never designed to work with the three
> character sets without generic characters, but in that case, should it
> not throw an error instead of doing cryptic stuff?

Thank you for noticing it.

Actually set-char-table-range is designed to work also with
those charsets.  Not working for them is simply a bug.  I'll
install a fix as soon as CVS server starts to access
commiting.

And, I've just noticed that the docstring says that RANGE
may be a coding system, but the code doesn't handle it.  The
only meaningful interpretation of RANGE being a coding
system is to treat all characters supported by the coding
system as target.  But, I think we don't have to support
such a facility.  So, I suggest to delete that part from the
docstring.

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: set-char-table-range with charset arguments
  2003-12-11  2:52 ` Kenichi Handa
@ 2003-12-11  3:17   ` Luc Teirlinck
  2003-12-11  4:17     ` Kenichi Handa
  0 siblings, 1 reply; 4+ messages in thread
From: Luc Teirlinck @ 2003-12-11  3:17 UTC (permalink / raw)
  Cc: emacs-devel

Ken'ichi Handa wrote:

   And, I've just noticed that the docstring says that RANGE
   may be a coding system, but the code doesn't handle it.  The
   only meaningful interpretation of RANGE being a coding
   system is to treat all characters supported by the coding
   system as target.  But, I think we don't have to support
   such a facility.  So, I suggest to delete that part from the
   docstring.

Actually the docstring of `set-char-table-range' says:

    Set the value in CHAR-TABLE for a range of characters RANGE to VALUE.
    RANGE should be t (for all characters), nil (for the default value)
    a vector which identifies a character set or a row of a character set,
    a coding system, or a character code.

Note that it not only wrongly mentions "coding system", but also fails
to mention "character set" (as such, that is, a symbol).  Maybe the
docstring should say:

Set the value in CHAR-TABLE for a range of characters RANGE to VALUE.
RANGE should be t (for all characters), nil (for the default value), 
a character set, a vector which identifies a character set or a row of
a character set, or a character code.  Return VALUE.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: set-char-table-range with charset arguments
  2003-12-11  3:17   ` Luc Teirlinck
@ 2003-12-11  4:17     ` Kenichi Handa
  0 siblings, 0 replies; 4+ messages in thread
From: Kenichi Handa @ 2003-12-11  4:17 UTC (permalink / raw)
  Cc: emacs-devel

In article <200312110317.hBB3HwW29087@raven.dms.auburn.edu>, Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> Actually the docstring of `set-char-table-range' says:

>     Set the value in CHAR-TABLE for a range of characters RANGE to VALUE.
>     RANGE should be t (for all characters), nil (for the default value)
>     a vector which identifies a character set or a row of a character set,
>     a coding system, or a character code.

> Note that it not only wrongly mentions "coding system", but also fails
> to mention "character set" (as such, that is, a symbol).

Ah, right.

> Maybe the docstring should say:

> Set the value in CHAR-TABLE for a range of characters RANGE to VALUE.
> RANGE should be t (for all characters), nil (for the default value), 
> a character set, a vector which identifies a character set or a row of
> a character set, or a character code.  Return VALUE.

I agree.

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-12-11  4:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-11  2:13 set-char-table-range with charset arguments Luc Teirlinck
2003-12-11  2:52 ` Kenichi Handa
2003-12-11  3:17   ` Luc Teirlinck
2003-12-11  4:17     ` Kenichi Handa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).