unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 32562@debbugs.gnu.org
Subject: bug#32562: 26; `read-char(-exclusive)' and `characterp'
Date: Tue, 28 Aug 2018 14:24:36 -0700 (PDT)	[thread overview]
Message-ID: <563c0c84-c4dd-4672-a009-df90bef6d6a3@default> (raw)
In-Reply-To: <CAM-tV-8iMCYG0rDwFXKD8fS2KPFy3v0icy9S+boxxTCimSjvxg@mail.gmail.com>

> forcemerge 13599 32562
> quit
> 
> > 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'.
> 
> This is bug#13599/1042

Hm. Maybe it is. But is `read-char' necessarily about chars that satisfy `characterp'?

I would think so, but maybe not. And there are other "character" functions, which accept chars as args - `text-char-description', for example. (That's what I was passing the result of `read-char' to.) 

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? Same thing as what `max-char' should recognize? Same thing as what `read-char' should consider a char? The Elisp manual (node Describing Characters) says it is "characters that appear in text—like ‘single-key-description’, except that..." It says nothing about "file characters". The doc is not too clear.

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)?

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?).

I think that "the bug" is not so clear cut as just adjusting `max-char'. I think the behavior of several functions that expect or return chars might deserve adjustment, and the doc might deserve some clarification/fixes. We might need to decide what the right behaviors are first.





  reply	other threads:[~2018-08-28 21:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 20:39 bug#32562: 26; `read-char(-exclusive)' and `characterp' Drew Adams
2018-08-28 20:51 ` Noam Postavsky
2018-08-28 21:24   ` Drew Adams [this message]
2018-08-28 22:27     ` Noam Postavsky
2018-09-10 10:01     ` Eli Zaretskii
2018-09-10  9:56 ` Eli Zaretskii
     [not found] <<3cce8b54-2e85-49a2-84d8-386ded864148@default>
     [not found] ` <<83d0tlpteu.fsf@gnu.org>
2018-09-10 13:43   ` Drew Adams
2018-09-10 14:04     ` Eli Zaretskii
2018-09-10 14:29     ` Andreas Schwab
2018-09-10 15:01       ` Drew Adams
2018-09-10 17:22         ` Eli Zaretskii
     [not found] <<<3cce8b54-2e85-49a2-84d8-386ded864148@default>
     [not found] ` <<<83d0tlpteu.fsf@gnu.org>
     [not found]   ` <<5f51bd06-84dd-47f5-a7da-b0c5814a274c@default>
     [not found]     ` <<83r2i1o3dr.fsf@gnu.org>
2018-09-10 14:57       ` Drew Adams
     [not found]     ` <<mvmtvmxctnm.fsf@suse.de>
     [not found]       ` <<3d6fb22f-de5a-4cce-bf49-023f2fc8388f@default>
     [not found]         ` <<83k1ntnu6l.fsf@gnu.org>
2018-09-10 19:48           ` Drew Adams
2018-09-11  7:57             ` Eli Zaretskii
2018-09-11 15:30               ` Drew Adams
2018-09-11 17:07                 ` Eli Zaretskii
     [not found]   ` <<<5f51bd06-84dd-47f5-a7da-b0c5814a274c@default>
     [not found]     ` <<<mvmtvmxctnm.fsf@suse.de>
     [not found]       ` <<<3d6fb22f-de5a-4cce-bf49-023f2fc8388f@default>
     [not found]         ` <<<83k1ntnu6l.fsf@gnu.org>
     [not found]           ` <<4df2c3ce-9dcb-483c-b733-f91f54f33bce@default>
     [not found]             ` <<831sa0o49d.fsf@gnu.org>
     [not found]               ` <<4d4aa5cd-964c-41c5-ae72-24769afb0bd0@default>
     [not found]                 ` <<83in3cm08g.fsf@gnu.org>
2018-09-11 17:22                   ` Drew Adams
2018-09-11 18:34                     ` Eli Zaretskii
     [not found] <<<<3cce8b54-2e85-49a2-84d8-386ded864148@default>
     [not found] ` <<<<83d0tlpteu.fsf@gnu.org>
     [not found]   ` <<<<5f51bd06-84dd-47f5-a7da-b0c5814a274c@default>
     [not found]     ` <<<<mvmtvmxctnm.fsf@suse.de>
     [not found]       ` <<<<3d6fb22f-de5a-4cce-bf49-023f2fc8388f@default>
     [not found]         ` <<<<83k1ntnu6l.fsf@gnu.org>
     [not found]           ` <<<4df2c3ce-9dcb-483c-b733-f91f54f33bce@default>
     [not found]             ` <<<831sa0o49d.fsf@gnu.org>
     [not found]               ` <<<4d4aa5cd-964c-41c5-ae72-24769afb0bd0@default>
     [not found]                 ` <<<83in3cm08g.fsf@gnu.org>
     [not found]                   ` <<eedf9125-6ece-44cb-a01b-b8da3d707e8c@default>
     [not found]                     ` <<83ftyfnarp.fsf@gnu.org>
2018-09-11 18:58                       ` Drew Adams
2018-09-11 19:03                         ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=563c0c84-c4dd-4672-a009-df90bef6d6a3@default \
    --to=drew.adams@oracle.com \
    --cc=32562@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).