unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: Daniel Colascione <dan.colascione@gmail.com>, 7006@debbugs.gnu.org
Subject: bug#7006: Reader oddity after ?\^ --- should signal error if invalid instead of being garbage
Date: Sat, 16 Jul 2011 22:16:59 -0400	[thread overview]
Message-ID: <jwvtyalzmdn.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m3hb6p6k3y.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Thu, 14 Jul 2011 15:57:05 +0200")

>> ?\^ is supposed to be the prefix for a control character --- for
>> example, ?\^g. However, the character following the ^ can be a
>> non-existent control character like ' ' or ')'. Currently, the reader
>> outputs a nonsense value in this case. Instead, the reader ought to
>> signal an error.

It's not "nonsense".

> ?\^9
> => 67108921
> That seems awfully confusing.
> (format "%x" 67108921)
> => "4000039"
> Does anybody know whether this a feature or a bug?

It's a feature.  The ?<something> syntax can be used for more than
chars: it can be used for any char and any combination of modifiers
(such as the control modifier above), where the modifiers are stored in
the upper bits of the number.

An exception is made for those few chars whose combination which control
exists in ASCII, where the ?\C-<char> is then represented by the
corresponding ASCII char rather than use the "control" modifier bit.


        Stefan





      parent reply	other threads:[~2011-07-17  2:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 21:25 bug#7006: Reader oddity after ?\^ --- should signal error if invalid instead of being garbage Daniel Colascione
2010-09-10  2:51 ` MON KEY
2011-07-14 13:57 ` Lars Magne Ingebrigtsen
2011-07-14 14:50   ` Andreas Schwab
2011-07-17  2:16   ` Stefan Monnier [this message]

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=jwvtyalzmdn.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=7006@debbugs.gnu.org \
    --cc=dan.colascione@gmail.com \
    --cc=larsi@gnus.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 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).