From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Federico Tedin Newsgroups: gmane.emacs.devel Subject: Questions regarding char-table-range RANGE arg Date: Thu, 31 Aug 2023 23:54:01 +0200 Message-ID: <182a9111-f3e1-e098-97ec-1f5a5269362d@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31135"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 01 07:29:55 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qbwjC-0007qo-Ga for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Sep 2023 07:29:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbwiJ-00068E-Ks; Fri, 01 Sep 2023 01:29:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbpc7-00028N-FH for emacs-devel@gnu.org; Thu, 31 Aug 2023 17:54:07 -0400 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbpc5-0003mM-1F for emacs-devel@gnu.org; Thu, 31 Aug 2023 17:54:07 -0400 Original-Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-52889bc61b6so1707210a12.0 for ; Thu, 31 Aug 2023 14:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693518843; x=1694123643; darn=gnu.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=uE9VLBiZKwqh9DlLcXeTOi90Qsg8U6iOVAf1r10Ryc0=; b=njfKzTKEVmkbmc8BppUrQnbwmD1qzCtp4I9jx2h+JzYzxECdGgrKrkZJj3gQrP40xE T07OT5iQnzyfrIcnlgcNHeg+hvtSibGCnHMwIaCAQd15OWacXpferjyqxMpk0eoGsl48 p3cr2v+F5PWTI1r2gqr5lomLarTeC2K98z0JsocXdaBT03LEC5MWK/3DuxhhWk20J9+F AE3mBTWGAnLyNq/xzZGWrJl4+/bea4E4mcbqSU7FstI1neWV5cRgkgEFwvhxo02/4Jkc fteLTf9qaGGuwYxaalE3DVlvj0MVT5CK49ARaYPn9uG2nBTT9zeeKCT7vW9gXmj3OVeQ Wz4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693518843; x=1694123643; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=uE9VLBiZKwqh9DlLcXeTOi90Qsg8U6iOVAf1r10Ryc0=; b=JWcLAJ5g10kcC0B8+aJJmgHEYvh9TAFy+jxpT80nbwAhl4teF106+fQhHi0r054l1u 5y0EnCID9CaCvhcs5aZhtcJvqKqcLl9QKbwsD07ncjThluBNZ9B/8FLoqOqJ+KF2EvNz nq9CHqcgzAYH8SXWwsgpTewS779vnhdryLq4CqhI4KhhTuuntiUYCHtUy2zTJ03lRgsJ sscYlFPZwl1AIaNqKcoGb6EB5WvmHPQ1FVLItn9FlqELoZr4gHqIZGiKnt/XgSoZuHQO mPQl5QQH5c2cHhNKvmfgI5tgz4ZSPM4PXHxoB+l3XxxlhrByC0DAI4youw4vr0LJ2NJe hdqQ== X-Gm-Message-State: AOJu0YzCJRgRM0v0wFhzR/y+FiwhA8zMW+UwT+n87lPp4Xc5iClSZ42F zLy+WMCA7YvZGiksyPOM/LwPigUApUk= X-Google-Smtp-Source: AGHT+IGyz19d+nIM9zqtzcxfjHpeeNNZZ3ogoxh7f6lMpvB5LhV/6dEzUxjllelTGoWi3OMJm2mZBw== X-Received: by 2002:aa7:da8b:0:b0:523:363e:f6e3 with SMTP id q11-20020aa7da8b000000b00523363ef6e3mr557439eds.15.1693518842586; Thu, 31 Aug 2023 14:54:02 -0700 (PDT) Original-Received: from [192.168.0.41] ([31.19.54.85]) by smtp.gmail.com with ESMTPSA id b22-20020aa7d496000000b0051dd19d6d6esm1281551edr.73.2023.08.31.14.54.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Aug 2023 14:54:02 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=federicotedin@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 01 Sep 2023 01:28:54 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309718 Archived-At: Hi everyone, I was trying to understand better how char tables work but I got stuck at the following: In the docs for `char-table-range' (https://www.gnu.org/software/emacs/manual/html_node/elisp/Char_002dTables.html), it is mentioned that it is possible to specify (from . to) as the value for RANGE. This already seemed a bit unexpected for me, as the function is supposed to retrieve a single value from the char table - how could it do it for a range, where potentially many different values could be defined? I did some tests: (setq tt (make-char-table nil)) (set-char-table-range tt (cons 10 20) "foo") (set-char-table-range tt (cons 21 25) "bar") (char-table-range tt (cons 5 15)) ; includes some "foo" values?   -> nil ; no (char-table-range tt (cons 10 15)) ; includes some "foo" values?   -> "foo" ; yes, makes sense (char-table-range tt (cons 15 22)) ; includes some "foo" and "bar" values?   -> "foo" ; ok, only the first range was considered (char-table-range tt (cons 15 0)) ; what if I set `to' to a nonsensical value?   -> "foo" (char-table-range tt (cons 15 99999)) ; or this one   -> "foo" (char-table-range tt (cons 26 30)) ; should return nil   -> nil ; ok So from my tests it seems like only `from' is considered? Similar to the case where RANGE is just a character. I was hoping someone with a better understanding of character tables could maybe explain the behaviour observed above. It is possible it could me just missinterpreting the documentation (I am trying to keep a more end-user perspective for this, i.e. not look at the Emacs source code and only use documentation). I did try looking also into chartab-tests.el though but could not find more information there. Thanks!