From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: char-table-range Date: Wed, 18 Feb 2004 19:28:55 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200402190128.i1J1StG21175@raven.dms.auburn.edu> References: <200402160043.JAA17207@etlken.m17n.org> <200402160130.i1G1UKG04241@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1077154752 8249 80.91.224.253 (19 Feb 2004 01:39:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2004 01:39:12 +0000 (UTC) Cc: handa@m17n.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Feb 19 02:39:02 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Atd9a-0007yQ-00 for ; Thu, 19 Feb 2004 02:39:02 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Atd9Z-0003vg-00 for ; Thu, 19 Feb 2004 02:39:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Atd8D-0000MX-E5 for emacs-devel@quimby.gnus.org; Wed, 18 Feb 2004 20:37:37 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Atd3R-0006cy-IX for emacs-devel@gnu.org; Wed, 18 Feb 2004 20:32:41 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Atd1c-0005wX-So for emacs-devel@gnu.org; Wed, 18 Feb 2004 20:31:21 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Atd0Q-0005M9-KF; Wed, 18 Feb 2004 20:29:34 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i1J1TOKt025172; Wed, 18 Feb 2004 19:29:24 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i1J1StG21175; Wed, 18 Feb 2004 19:28:55 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Wed, 18 Feb 2004 18:38:40 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20061 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20061 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> ============================================================