all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Juri Linkov'" <juri@jurta.org>
Cc: 13177@debbugs.gnu.org
Subject: bug#13177: 24.3.50; doc of `read-char-by-name'
Date: Sun, 16 Dec 2012 08:31:18 -0800	[thread overview]
Message-ID: <30C2FE288AE34DC698FA04B884D98FB3@us.oracle.com> (raw)
In-Reply-To: <8738z6r8pj.fsf@mail.jurta.org>

> > Great.  That's what I would prefer also.  And that was exactly what
> > I said in the original bug report: that's what the other `read*'
> > functions do: return the thing their names say they read.
> 
> `read-char' says it reads a character but it returns 0 (^@) for
> invalid characters.  I see no reason why 0 would be better than nil.
> Using an arbitrary character ^@ for invalid characters makes no sense.

OK, perhaps my analogy was too black & white.  Let's try to deal with
`read-char' exceptions to returning a char in a separate thread.  Keep in mind,
though, that `read-char' has been around even longer (a lot longer) than
`read-char-by-name', so changes would like affect more 3rd-party code.

Also, `read-char' returns non-char events, which is why we also have
`read-char-exclusive'.  Anyway, let's not let my analogy get in the way too
much; let's concentrate here on `read-char-by-name' and try to figure out what
the best behavior (and then doc) would be.

> > So we start with a code bug - make sure it always returns a char.
> > Then we fix the doc.  Anyway, FWIW you've got my vote in favor of
> > fixing the code to always return a char.
> 
> Also in bug#13195 the same request:
> 
> > Seems like `read-char-by-name' should always return something
> > that `insert-char' can use, i.e., something that passes 
> > `characterp'.
> 
> Yes, to always return a valid char or nil, we could check for 
> `characterp' like in the patch below.

Why return nil ever?  That's still part of the discussion, AFAIK.  nil is not a
character.






  parent reply	other threads:[~2012-12-16 16:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14  4:01 bug#13177: 24.3.50; doc of `read-char-by-name' Drew Adams
2012-12-15 11:09 ` Juri Linkov
2012-12-15 14:54   ` Stefan Monnier
2012-12-15 15:18     ` Juri Linkov
2012-12-15 15:47       ` Stefan Monnier
2012-12-15 16:08     ` Drew Adams
2012-12-15 23:20       ` Stefan Monnier
2012-12-15 23:39         ` Drew Adams
2012-12-16  9:12           ` Juri Linkov
2012-12-16 10:18             ` Andreas Schwab
2012-12-16 10:49               ` Juri Linkov
2012-12-16 16:34                 ` Drew Adams
2012-12-16 16:31             ` Drew Adams [this message]
2012-12-21  7:53         ` Chong Yidong
2012-12-21  8:04           ` Drew Adams
2012-12-15 15:52   ` Drew Adams
2012-12-15 16:08     ` Eli Zaretskii
2012-12-15 16:23       ` Drew Adams

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

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

  git send-email \
    --in-reply-to=30C2FE288AE34DC698FA04B884D98FB3@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=13177@debbugs.gnu.org \
    --cc=juri@jurta.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.