all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: handa@m17n.org, emacs-devel@gnu.org
Subject: Re: char-table-range
Date: Wed, 18 Feb 2004 19:28:55 -0600 (CST)	[thread overview]
Message-ID: <200402190128.i1J1StG21175@raven.dms.auburn.edu> (raw)
In-Reply-To: <E1AtbH6-0007WR-SX@fencepost.gnu.org> (message from Richard Stallman on Wed, 18 Feb 2004 18:38:40 -0500)

Richard Stallman wrote:

   Is there any other convenient way to get the default value and always
   the default value?  For instance, by using a generic character?

That seems to work.

       I did not realize that currently, for charsets different from ascii and
       eight-bit-{control,graphic}, char-table-range actually returns the
       entire range of values if the value is not uniform.

   That seems like a good thing for it to to.

Yes, but Handa remarked that the return value is given in a form
(sub-char-table) which is not supposed to be exported to Lisp.

I am currently reading the Elisp chapter on sequences.  In the section
on chartables several things are wrongly, incompletely or ambiguously
documented.  I will take care of that, but I do not want to "document"
bugs.

Apart from the problem we are discussing right now, there are two
other things that seem surprising to me about chartables.  I am not
necessarily claiming that they are bugs or misfeatures, I just want to
make sure that they are not before documenting them.

One seems very closely related to what we are currently discussing:

While it does seem possible to get the default value by specifying a
generic character, there is a strange subtle asymmetry between
_setting_ the default value for, say, ipa, and setting the
corresponding generic character (6272 in this case).

Setting the default value using `set-char-table-default' does _not_
override non-nil pre-existing values in the charset _except_ for the
generic character itself.  Setting the generic character itself
overrides the entire charset.  Is this intentional?  If yes, I will
clearly document it (because it is confusing).

The second thing that looks _somewhat_ strange (but maybe it is OK) is
that (make-char-table subtype init) will also set extra slots to INIT.
This is somewhat unexpected because a logical default for characters
would seldom seem to make sense for extra slots as well.  Maybe this
is intentional anyway.  In that case I will document it.

ielm run illustrating all of the above:

===File ~/chartable-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 2))
#^[t 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 nil five-slots 2 2 2 2 2]

ELISP> (char-table-extra-slot cc 3)
2
ELISP> (make-char 'ipa)
6272
ELISP> (split-char 6320)
(ipa 48)

ELISP> (aset cc 6320 7)
7
ELISP> (aset cc 6272 1)
1
ELISP> (aref cc 6320)
1
ELISP> (aset cc 6320 7)
7
ELISP> (set-char-table-default cc 6272 8)
8
ELISP> (aref cc 6272)
8
ELISP> (aref cc 6320)
7
ELISP> (char-table-range cc 'ipa)
#^^[nil 8 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil 7 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]

ELISP> 
============================================================

  reply	other threads:[~2004-02-19  1:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-16  0:43 char-table-range Kenichi Handa
2004-02-16  1:30 ` char-table-range Luc Teirlinck
2004-02-18 23:38   ` char-table-range Richard Stallman
2004-02-19  1:28     ` Luc Teirlinck [this message]
2004-02-19 15:40       ` char-table-range Luc Teirlinck
2004-02-20 13:42       ` char-table-range Richard Stallman
2004-02-21  0:03         ` char-table-range Luc Teirlinck
     [not found]           ` <200403020247.LAA16492@etlken.m17n.org>
2004-03-03  3:39             ` char-table-range Luc Teirlinck
2004-03-03  4:50               ` char-table-range Kenichi Handa
2004-03-04 16:41                 ` char-table-range Richard Stallman
2004-03-03  4:51               ` char-table-range Kenichi Handa
2004-02-19  1:52     ` char-table-range Luc Teirlinck
2004-02-20 13:42       ` char-table-range Richard Stallman
2004-02-16  2:12 ` char-table-range Luc Teirlinck
2004-02-16  4:08   ` char-table-range Kenichi Handa
2004-02-18 17:55 ` char-table-range Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200402190128.i1J1StG21175@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.