From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#4751: 23.1; `read-char' inserts accented chars when you use `M-' modifier Date: Tue, 20 Oct 2009 08:05:55 -0700 Message-ID: <5915254BB95348E2BB2962DF2A524778@us.oracle.com> References: <5FBBD1BB0E704C769D622880A6ED636B@us.oracle.com><51BBB2631ACF4B43B6E9691BDA0B11F7@us.oracle.com> Reply-To: Drew Adams , 4751@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1256052464 12820 80.91.229.12 (20 Oct 2009 15:27:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 Oct 2009 15:27:44 +0000 (UTC) Cc: 4751@emacsbugs.donarmstrong.com To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 20 17:27:35 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N0GcY-0004zX-VA for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Oct 2009 17:27:35 +0200 Original-Received: from localhost ([127.0.0.1]:50622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0GcY-0000cO-5N for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Oct 2009 11:27:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0GcM-0000Wd-Ks for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2009 11:27:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0GcG-0000RA-LT for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2009 11:27:21 -0400 Original-Received: from [199.232.76.173] (port=37698 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0GcG-0000Qp-F6 for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2009 11:27:16 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:40444) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N0GcF-0001Mq-QK for bug-gnu-emacs@gnu.org; Tue, 20 Oct 2009 11:27:16 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9KFRCke016870; Tue, 20 Oct 2009 08:27:13 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n9KFF5uO015054; Tue, 20 Oct 2009 08:15:05 -0700 Resent-Date: Tue, 20 Oct 2009 08:15:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Tue, 20 Oct 2009 15:15:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4751 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4751-submit@emacsbugs.donarmstrong.com id=B4751.125605126814184 (code B ref 4751); Tue, 20 Oct 2009 15:15:05 +0000 Original-Received: (at 4751) by emacsbugs.donarmstrong.com; 20 Oct 2009 15:07:48 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from rgminet12.oracle.com (rcsinet12.oracle.com [148.87.113.124]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9KF7lEr014178 for <4751@emacsbugs.donarmstrong.com>; Tue, 20 Oct 2009 08:07:48 -0700 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9KF7G6k007741 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Oct 2009 15:07:17 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9JIu1em025169; Tue, 20 Oct 2009 15:07:38 GMT Original-Received: from abhmt013.oracle.com by acsmt355.oracle.com with ESMTP id 20509054441256051169; Tue, 20 Oct 2009 08:06:09 -0700 Original-Received: from dradamslap1 (/141.144.122.14) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 20 Oct 2009 08:06:08 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcpRjG9qWPjcXJ1WT+K8ygz82OQmPgABr+Kg In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt358.oracle.com [141.146.40.158] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.4ADDD23A.006C:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 20 Oct 2009 11:27:21 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32131 Archived-At: > Yes, but it's a change that was done on purpose (at least > the code is quite explicit), so undoing it is a bit risky. > Hmm... OK, I just reverted that part of the change, we'll see > what happens. > > The fundamental problem is that read-char is ill-defined: on the one > hand, it wants to return "raw undecoded events" and on the other it > wants to return chars (which in the general case need > decoding, e.g. to > turn an escape sequence into and then into the char > ?3) and uses > a far-reaching definition of "char" (basically: any event > represented by an integer). There are those two cases: decoding vs any integer. But there are also three cases for integers, apparently: (1) any integer, (2) any integer < 4194303, (3) any integer small enough that the char can be used in a string or buffer (which limit is apparently greater than 4194303). I'm also confused about `characterp' and the notion of a character. `(elisp)Character Type' says that only integers/chars from 0 to 4194303 can be in strings or buffers. But ?\M-t is 134217844, yet "\M-t" is a string with that char (`o' circumflex), and (insert-char ?\M-t 1) inserts it in a buffer. That doc is confusing - is it also incorrect? There is also the ambiguity I mentioned in the too-sparse doc for `characterp': The function returns non-nil only for a subset of the chars that can be used in a string or buffer. What is that subset (it seems to be chars < 4194304)? This needs to be documented, IMO. Or is there perhaps also a bug for `characterp' and it should return t for ?\M-t? Currently, characterp seems to respect the 4194303 limit: (characterp 4194303) = t, (characterp 4194304) = nil. Wrt `read-char' what is/are the intention(s) - use cases? Should it too only return `characterp' chars (assuming there is no `characterp' bug), and signal an error for a non-characterp event? In which case `read-char-exclusive' would ignore such events and wait until getting a `characterp' char. That is one use case - I've seen code that uses `read-char' in a loop to accumulate a string of chars, and in some cases it seems unlikely that what is really wanted is a string that can contain meta chars. Or should `read-char' return any char, even one beyond the limit of being representable in strings and buffer (whatever the correct limit is - it doesn't seem to be 4194303)? In which case, if a user really wants a characterp char, e.g. in order to accumulate in a string, s?he would test using `characterp' before accumulating. Or should `read-char' accept another arg to determine the behavior. As you can see, I'm still confused - have questions.