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 12:56:41 +0300 Message-ID: <83d0tlpteu.fsf@gnu.org> References: <3cce8b54-2e85-49a2-84d8-386ded864148@default> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1536574396 27594 195.159.176.226 (10 Sep 2018 10:13:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2018 10:13:16 +0000 (UTC) Cc: 32562@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:13:12 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 1fzJBw-000758-6b for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2018 12:13:12 +0200 Original-Received: from localhost ([::1]:50726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzJE2-0006t6-QH for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2018 06:15:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzJBE-0004CQ-SQ for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2018 06:12:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzIwI-000274-K0 for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2018 05:57:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46740) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzIwI-00026z-ET for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2018 05:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fzIwI-0001fd-9T for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2018 05:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Sep 2018 09:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32562-submit@debbugs.gnu.org id=B32562.15365734046393 (code B ref 32562); Mon, 10 Sep 2018 09:57:02 +0000 Original-Received: (at 32562) by debbugs.gnu.org; 10 Sep 2018 09:56:44 +0000 Original-Received: from localhost ([127.0.0.1]:51758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzIw0-0001f3-4P for submit@debbugs.gnu.org; Mon, 10 Sep 2018 05:56:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzIvy-0001er-SN for 32562@debbugs.gnu.org; Mon, 10 Sep 2018 05:56:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzIvq-0001vF-HW for 32562@debbugs.gnu.org; Mon, 10 Sep 2018 05:56:37 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzIvq-0001v7-Dl; Mon, 10 Sep 2018 05:56:34 -0400 Original-Received: from [176.228.60.248] (port=3977 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fzIvq-000571-0r; Mon, 10 Sep 2018 05:56:34 -0400 In-reply-to: <3cce8b54-2e85-49a2-84d8-386ded864148@default> (message from Drew Adams on Tue, 28 Aug 2018 13:39:20 -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:150182 Archived-At: > Date: Tue, 28 Aug 2018 13:39:20 -0700 (PDT) > From: Drew Adams > > Perhaps there is no bug here, other than incomplete or insufficiently > clear doc. Dunno. It's a documentation bug. > emacs -Q > M-: (setq foo (read-char "Char: ")) > M-: > > shows: 134217786 (#o1000000072, #x800003a), a number too large > to be `characterp'. And M-: (characterp foo) ; returns nil. > > Same thing for `read-char-exclusive'. > > Something seems wrong. The doc for `read-char(-exclusive)' talks about > reading a character. For `read-char' it says that it raises an error for > a non-char event. And for `read-char-exclusive' it says that it ignores > non-char events that it reads. > > But they both seem to read the event from `M-:' and return its value > (a number). And it is not a character, according to `characterp'. What the documentation failed to make clear is that the value returned by these functions is an _event_, not a character. For ASCII characters, the event and the character are identical, but modifier bits that cannot be resolved to yield an ASCII character are left in the returned value, and that makes the value not a valid character code. I have now clarified this subtle point in the documentation (on the emacs-26 branch). > And what function reads a `characterp' character, either ignoring > anything else or raising an error for anything else? What do you mean by "reading a 'characterp'"? E.g., if the user types C-% or M-a, what 'characterp' code would you expect to see? Also, does "reading a 'characterp'" include supporting input methods, if any?