From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32562: 26; `read-char(-exclusive)' and `characterp' Date: Mon, 10 Sep 2018 13:01:11 +0300 Message-ID: <83bm95pt7c.fsf@gnu.org> References: <3cce8b54-2e85-49a2-84d8-386ded864148@default> <563c0c84-c4dd-4672-a009-df90bef6d6a3@default> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1536574332 22837 195.159.176.226 (10 Sep 2018 10:12:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2018 10:12:12 +0000 (UTC) Cc: npostavs@gmail.com, 32562-done@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 10 12:12:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzJAt-0005pE-KI for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2018 12:12:07 +0200 Original-Received: from localhost ([::1]:50715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzJD0-000674-3m for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2018 06:14:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzJAh-0002lD-JZ for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2018 06:11:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzJ18-0005IK-Sj for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2018 06:02:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46745) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzJ18-0005I9-MT for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2018 06:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fzJ18-0001oO-KC for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2018 06:02:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Sep 2018 10:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 32562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 32562@debbugs.gnu.org, eliz@gnu.org, drew.adams@oracle.com Original-Received: via spool by 32562-done@debbugs.gnu.org id=D32562.15365736756899 (code D ref 32562); Mon, 10 Sep 2018 10:02:02 +0000 Original-Received: (at 32562-done) by debbugs.gnu.org; 10 Sep 2018 10:01:15 +0000 Original-Received: from localhost ([127.0.0.1]:51762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzJ0L-0001nB-NR for submit@debbugs.gnu.org; Mon, 10 Sep 2018 06:01:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzJ0J-0001mx-W2 for 32562-done@debbugs.gnu.org; Mon, 10 Sep 2018 06:01:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzJ0B-0004ZS-NK for 32562-done@debbugs.gnu.org; Mon, 10 Sep 2018 06:01:06 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzJ0B-0004ZM-Jc; Mon, 10 Sep 2018 06:01:03 -0400 Original-Received: from [176.228.60.248] (port=4263 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fzJ0B-0005tn-7N; Mon, 10 Sep 2018 06:01:03 -0400 In-reply-to: <563c0c84-c4dd-4672-a009-df90bef6d6a3@default> (message from Drew Adams on Tue, 28 Aug 2018 14:24:36 -0700 (PDT)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150181 Archived-At: > Date: Tue, 28 Aug 2018 14:24:36 -0700 (PDT) > From: Drew Adams > Cc: 32562@debbugs.gnu.org > > is `read-char' necessarily about chars that satisfy `characterp'? No. It returns a character event, not a character. > The doc string of `text-char-description' says "file-character CHARACTER". What's a "file character"? A character that can appear in a file name? No, text-char-description accepts only valid character codes, those which satisfy the 'characterp' test. This is unlike single-key-description, which accepts _events_, and thus will happily process character input events that are not valid character codes, i.e. fail the 'characterp' test. I've now made that clear in the respective doc strings. > This stuff is not clear more generally, I think - beyond the max value of `max-char'. Do we have or want to have different kinds of "characters" returned from or passed as args to different "character" functions? Why (or why not)? The basic difference is between a character code and a character input event. > Wrt my original problem: taking a value of `M-:' from `read-char' and passing it to `text-char-description', Emacs has a regression of sorts. Older Emacs versions "work", whereas recent versions raise an error. E.g. Emacs 20 `read-char' returns -134217670, and passing that to `text-char-description' gives "\272". Whatever `read-char' can read, it seems, `text-char-description' can describe (perhaps imperfectly?). It's not a regression: text-char-description wants a valid character code. I'm closing this bug, as I think this is a documentation issue which is now fixed. Thanks.