From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 13 23:02:56 2012 Received: (at submit) by debbugs.gnu.org; 14 Dec 2012 04:02:56 +0000 Received: from localhost ([127.0.0.1]:41627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjMUC-0001t4-2P for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:02:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33239) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjMU9-0001sx-Sf for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:02:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjMTE-0004Sh-Mr for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:01:58 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-104.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:56357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjMTE-0004Sd-Ja for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:01:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjMTC-00014A-Lg for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 23:01:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjMTB-0004S6-ET for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 23:01:54 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:49415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjMTB-0004Rs-7h for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 23:01:53 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBE41p83009847 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Dec 2012 04:01:52 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBE41oks015984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 14 Dec 2012 04:01:51 GMT Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBE41oMt000381 for ; Thu, 13 Dec 2012 22:01:50 -0600 Received: from dradamslap1 (/10.159.136.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 13 Dec 2012 20:01:50 -0800 From: "Drew Adams" To: Subject: 24.3.50; doc of `read-char-by-name' Date: Thu, 13 Dec 2012 20:01:47 -0800 Message-ID: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac3Zr7y28FL2PGEfQcuVsSNdtgQMqg== X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Emacs-Lisp `read*' functions generally return what they say they read. This function does not necessarily return a character, which is what its doc says it does. It can return nil. The doc needs to mention this behavior, especially as it is pretty exceptional. There's nothing wrong with such behavior, but I wonder a bit whether this function shouldn't perhaps use `completing-read' with a non-nil REQUIRE-MATCH argument. IOW, perhaps it should ignore names that are unknown. In that case it would always do what the doc currently says it does: return a character (by name). At least it's another possibility. Dunno just what the intention was for this function. If it really was to return a recognized Unicode character then this is a product bug and reading should not end until the user enters matching input (or hits `C-g'). If the intention was really to do what the function does now, then this is a doc bug: mention a possible nil return value and what it means. Alternatively, we might add another function, say `read-char-by-name-exclusive', that always returns a named char. That would be somewhat analogous to how `read-char-exclusive' ignores non-chars, while `read-char' signals an error for them. (Note though that neither of those functions simply accepts and returns a non-char event.) Anyway, for this bug report and for my part, it would be enough to correct the doc to say that if the user enters a name that is unknown then nil is returned. In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600) of 2012-12-13 on ODIEONE Bzr revision: 111211 eggert@cs.ucla.edu-20121213021749-eyqqen0ewhn2hogq Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.7) --no-opt --enable-checking --cflags -IC:/Devel/emacs/build/include -Wall -Wextra -Wno-sign-compare -Wno-type-limits -Wno-missing-field-initializers -Wno-pointer-sign -Wdeclaration-after-statement --ldflags -LC:/Devel/emacs/build/lib' From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 06:15:26 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 11:15:26 +0000 Received: from localhost ([127.0.0.1]:43376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjpiH-0000iF-NL for submit@debbugs.gnu.org; Sat, 15 Dec 2012 06:15:26 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:52745 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjpiG-0000i9-Bn for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 06:15:24 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 52948451CBE4; Sat, 15 Dec 2012 03:14:20 -0800 (PST) From: Juri Linkov To: "Drew Adams" Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' Organization: JURTA References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> Date: Sat, 15 Dec 2012 13:09:39 +0200 In-Reply-To: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> (Drew Adams's message of "Thu, 13 Dec 2012 20:01:47 -0800") Message-ID: <8762431shy.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) > Dunno just what the intention was for this function. If it really > was to return a recognized Unicode character then this is a product > bug and reading should not end until the user enters matching input > (or hits `C-g'). As its docstring says, it also accepts a hexadecimal number of Unicode code whose input can't use completion. > Anyway, for this bug report and for my part, it would be enough > to correct the doc to say that if the user enters a name that > is unknown then nil is returned. Then this patch would be enough: === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2012-10-11 20:05:47 +0000 +++ lisp/international/mule-cmds.el 2012-12-15 11:09:03 +0000 @@ -2944,7 +2944,10 @@ (defun read-char-by-name (prompt) This function also accepts a hexadecimal number of Unicode code point or a number in hash notation, e.g. #o21430 for octal, -#x2318 for hex, or #10r8984 for decimal." +#x2318 for hex, or #10r8984 for decimal. + +When input is neither a known Unicode name nor a hex number string, +return nil." (let ((input (completing-read prompt From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 09:55:28 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 14:55:28 +0000 Received: from localhost ([127.0.0.1]:43624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tjt9D-0006q3-SD for submit@debbugs.gnu.org; Sat, 15 Dec 2012 09:55:28 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:30719) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tjt9B-0006pc-VK for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 09:55:26 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09MCoyD/2dsb2JhbABEsEiDSYEIghUBAQQBViMQCzQSFBgNJIgcBboJkEQDiEKacYFYgwc X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="209985552" Received: from 76-10-140-131.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([76.10.140.131]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Dec 2012 09:54:21 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 5E4D6AE3F7; Sat, 15 Dec 2012 09:54:21 -0500 (EST) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' Message-ID: References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> Date: Sat, 15 Dec 2012 09:54:21 -0500 In-Reply-To: <8762431shy.fsf@mail.jurta.org> (Juri Linkov's message of "Sat, 15 Dec 2012 13:09:39 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) >> Dunno just what the intention was for this function. If it really >> was to return a recognized Unicode character then this is a product >> bug and reading should not end until the user enters matching input >> (or hits `C-g'). > As its docstring says, it also accepts a hexadecimal number > of Unicode code whose input can't use completion. That does not preclude using require-match. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 10:36:47 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 15:36:47 +0000 Received: from localhost ([127.0.0.1]:44212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjtnB-0007tk-JR for submit@debbugs.gnu.org; Sat, 15 Dec 2012 10:36:46 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:57149 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tjtn5-0007tW-H6 for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 10:36:42 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 5C2EB451CD0B; Sat, 15 Dec 2012 07:35:33 -0800 (PST) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' Organization: JURTA References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> Date: Sat, 15 Dec 2012 17:18:35 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 15 Dec 2012 09:54:21 -0500") Message-ID: <87r4mrl4gq.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) >>> Dunno just what the intention was for this function. If it really >>> was to return a recognized Unicode character then this is a product >>> bug and reading should not end until the user enters matching input >>> (or hits `C-g'). >> As its docstring says, it also accepts a hexadecimal number >> of Unicode code whose input can't use completion. > > That does not preclude using require-match. I guess you mean adding a predicate that will check input for a valid hex number? It could act as an union of character name completions and a predicate to check hex numbers. But I don't imagine how to combine them without adding a large list of all possible hex numbers to the completion list. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 10:48:47 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 15:48:47 +0000 Received: from localhost ([127.0.0.1]:44229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tjtyo-0008Da-Tf for submit@debbugs.gnu.org; Sat, 15 Dec 2012 10:48:47 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:23048) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tjtyn-0008DU-8h for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 10:48:45 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09MCoyD/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDSSIHAW6CZBEA4hCmnGBWIMH X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="209987303" Received: from 76-10-140-131.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([76.10.140.131]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Dec 2012 10:47:40 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 0AA25AE3F8; Sat, 15 Dec 2012 10:47:38 -0500 (EST) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' Message-ID: References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> <87r4mrl4gq.fsf@mail.jurta.org> Date: Sat, 15 Dec 2012 10:47:38 -0500 In-Reply-To: <87r4mrl4gq.fsf@mail.jurta.org> (Juri Linkov's message of "Sat, 15 Dec 2012 17:18:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) > I guess you mean adding a predicate that will check input > for a valid hex number? It could act as an union of > character name completions and a predicate to check hex numbers. > But I don't imagine how to combine them without adding > a large list of all possible hex numbers to the completion list. The completion table can be a function. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 10:54:08 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 15:54:08 +0000 Received: from localhost ([127.0.0.1]:44237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tju3z-0008Lc-Qu for submit@debbugs.gnu.org; Sat, 15 Dec 2012 10:54:08 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:37483) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tju3x-0008LV-O8 for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 10:54:06 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBFFqxJW030116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 15 Dec 2012 15:53:00 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBFFqxew006738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 15:52:59 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBFFqwvu028366; Sat, 15 Dec 2012 09:52:59 -0600 Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 15 Dec 2012 07:52:58 -0800 From: "Drew Adams" To: "'Juri Linkov'" References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> Subject: RE: bug#13177: 24.3.50; doc of `read-char-by-name' Date: Sat, 15 Dec 2012 07:52:51 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <8762431shy.fsf@mail.jurta.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac3atVVh2/8mzRa/Qa6kwGbbY3hH2wAIcsqA X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.5 (-) > > Dunno just what the intention was for this function. If it really > > was to return a recognized Unicode character then this is a product > > bug and reading should not end until the user enters matching input > > (or hits `C-g'). > > As its docstring says, it also accepts a hexadecimal number > of Unicode code whose input can't use completion. Yes, I know. But the doc string also says that the hex numbers accepted are those corresponding to Unicode code points. And it mentions hash notation for numbers, but in that case it does not say that those numbers too must correspond to Unicode code points. The question I posed is whether the intention was to always return a recognized Unicode char. If that is the case then the function should never return nil or anything else (e.g. a non code-point number) other than a Unicode char. It's an open question. If you are answering for the design intention, stating that the intention is not to do what the doc currently says (always return a Unicode char), then fine. In that case, all that's needed is a doc-string patch, to point out that exception to its general statement. However (see below), that exception needs to be clarified in the case of hash notation input that does not correspond to a Unicode char. > +When input is neither a known Unicode name nor a hex number string, > +return nil." It is not enough, according to the existing doc string, for input to be any old hex number - it must be a "hexadecimal number of Unicode code point" - or presumably we return nil (?). The additional info should say this (or equivalent): "Return nil if the input does not correspond to a Unicode character." The doc string should also be corrected to not give the impression that hash notation input somehow escapes this need for the number to represent a character, i.e., to be numerically equivalent to "a hexadecimal number of Unicode code point". So we should replace the last paragraph of the doc string with something like this: "Besides a Unicode character name, input can represent a Unicode character numerically. It can be a hexadecimal number or a number in hash notation, e.g. #o21430 for octal, #x2318 for hex, or #10r8984 for decimal." Follow that with the statement above that _any other_ input, i.e., any input that does not correspond to a recognized Unicode char, means return nil. Then things will be clear. Otherwise, we are not saying anything about what is returned if the input hash notation does not correspond to a Unicode char - a doc bug. If, on the other hand, it is not the case that the function returns nil for hash notation input that does not correspond to a known character, then the doc should say that clearly. In that case, the function has two exceptions to returning a Unicode character: 1. Return nil if a name is entered that is not a recognized name. 2. Return a number if hash notation is entered that does not match a Unicode code point. I cannot speak for what the function is supposed to do (design), so I cannot say whether there is a code bug or a doc bug here. I can only outline the possibilities. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 11:09:24 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 16:09:24 +0000 Received: from localhost ([127.0.0.1]:44254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjuIl-0000Gl-P7 for submit@debbugs.gnu.org; Sat, 15 Dec 2012 11:09:24 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:27873) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjuIj-0000Ge-TT for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 11:09:22 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBFG8GUp005591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 15 Dec 2012 16:08:17 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBFG8FZM017995 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 16:08:15 GMT Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBFG8EXr008540; Sat, 15 Dec 2012 10:08:15 -0600 Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 15 Dec 2012 08:08:14 -0800 From: "Drew Adams" To: "'Stefan Monnier'" , "'Juri Linkov'" References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com><8762431shy.fsf@mail.jurta.org> Subject: RE: bug#13177: 24.3.50; doc of `read-char-by-name' Date: Sat, 15 Dec 2012 08:08:08 -0800 Message-ID: <9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac3a1BJiT/2W31AxQcC4ujrZVYVMXwACfuLA X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.5 (-) > >> Dunno just what the intention was for this function. If it really > >> was to return a recognized Unicode character then this is a product > >> bug and reading should not end until the user enters matching input > >> (or hits `C-g'). > > > As its docstring says, it also accepts a hexadecimal number > > of Unicode code whose input can't use completion. > > That does not preclude using require-match. Yes. The problem for me is that I don't know what the intention (design) was or why. Maybe someone has a good reason to return nil or to return a number that does not correspond to a recognized code point? The design should be clarified (and perhaps decided/changed, if appropriate) before we try to fit the doc to it. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 11:10:24 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 16:10:24 +0000 Received: from localhost ([127.0.0.1]:44258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjuJk-0000IL-5z for submit@debbugs.gnu.org; Sat, 15 Dec 2012 11:10:24 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]:58391) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjuJi-0000IE-2Y for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 11:10:23 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MF200G00XQTI800@a-mtaout21.012.net.il> for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 18:08:40 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MF200GYDY6AI620@a-mtaout21.012.net.il>; Sat, 15 Dec 2012 18:08:35 +0200 (IST) Date: Sat, 15 Dec 2012 18:08:39 +0200 From: Eli Zaretskii Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' In-reply-to: X-012-Sender: halo1@inter.net.il To: Drew Adams Message-id: <836243mh6g.fsf@gnu.org> References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > From: "Drew Adams" > Date: Sat, 15 Dec 2012 07:52:51 -0800 > Cc: 13177@debbugs.gnu.org > > > As its docstring says, it also accepts a hexadecimal number > > of Unicode code whose input can't use completion. > > Yes, I know. But the doc string also says that the hex numbers accepted are > those corresponding to Unicode code points. And it mentions hash notation for > numbers, but in that case it does not say that those numbers too must correspond > to Unicode code points. [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [80.179.55.169 listed in list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.5000] X-Debbugs-Envelope-To: 13177 Cc: juri@jurta.org, 13177@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > From: "Drew Adams" > Date: Sat, 15 Dec 2012 07:52:51 -0800 > Cc: 13177@debbugs.gnu.org > > > As its docstring says, it also accepts a hexadecimal number > > of Unicode code whose input can't use completion. > > Yes, I know. But the doc string also says that the hex numbers accepted are > those corresponding to Unicode code points. And it mentions hash notation for > numbers, but in that case it does not say that those numbers too must correspond > to Unicode code points. [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [80.179.55.169 listed in list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4914] > From: "Drew Adams" > Date: Sat, 15 Dec 2012 07:52:51 -0800 > Cc: 13177@debbugs.gnu.org > > > As its docstring says, it also accepts a hexadecimal number > > of Unicode code whose input can't use completion. > > Yes, I know. But the doc string also says that the hex numbers accepted are > those corresponding to Unicode code points. And it mentions hash notation for > numbers, but in that case it does not say that those numbers too must correspond > to Unicode code points. #xNNNNN can also specify 8-bit characters whose codepoints are outside Unicode. I have no idea whether this distinction is relevant to this function, but since it talks about "Unicode code points", people who deal with the documentation need to be aware of this subtlety. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 11:25:15 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 16:25:15 +0000 Received: from localhost ([127.0.0.1]:44275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjuY7-0000du-7w for submit@debbugs.gnu.org; Sat, 15 Dec 2012 11:25:15 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:24444) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjuY5-0000dm-2C for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 11:25:14 -0500 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBFGO6wb027255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 15 Dec 2012 16:24:07 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBFGO6rv010556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 16:24:06 GMT Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBFGO5SN017743; Sat, 15 Dec 2012 10:24:05 -0600 Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 15 Dec 2012 08:24:05 -0800 From: "Drew Adams" To: "'Eli Zaretskii'" References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> <836243mh6g.fsf@gnu.org> Subject: RE: bug#13177: 24.3.50; doc of `read-char-by-name' Date: Sat, 15 Dec 2012 08:23:58 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <836243mh6g.fsf@gnu.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac3a3omdakkYkBdWT0WSesXGPDIGUAAAc2pA X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13177 Cc: juri@jurta.org, 13177@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.5 (-) > #xNNNNN can also specify 8-bit characters whose codepoints are outside > Unicode. > > I have no idea whether this distinction is relevant to this function, > but since it talks about "Unicode code points", people who deal with > the documentation need to be aware of this subtlety. Precisely. Is `read-char-by-name' intended to just return such a non code-point number or should it always return a Unicode char as it name suggests? Once we know what the intention is, if the code doesn't fit it we can change the code. Once we know what the correct code does, we can fit the doc to it. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 18:21:23 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 23:21:23 +0000 Received: from localhost ([127.0.0.1]:44462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk12o-0002cf-Va for submit@debbugs.gnu.org; Sat, 15 Dec 2012 18:21:23 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:19846) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk12n-0002cY-0y for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 18:21:21 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09MCoyD/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDSSIHAW6CZBEA4hCmnGBWIMH X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="210001722" Received: from 76-10-140-131.dsl.teksavvy.com (HELO pastel.home) ([76.10.140.131]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Dec 2012 18:20:14 -0500 Received: by pastel.home (Postfix, from userid 20848) id BC1F84E038; Sat, 15 Dec 2012 18:20:13 -0500 (EST) From: Stefan Monnier To: "Drew Adams" Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' Message-ID: References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> <9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> Date: Sat, 15 Dec 2012 18:20:13 -0500 In-Reply-To: <9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> (Drew Adams's message of "Sat, 15 Dec 2012 08:08:08 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13177 Cc: 'Juri Linkov' , 13177@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) > The problem for me is that I don't know what the intention (design) > was or why. Maybe someone has a good reason to return nil or to > return a number that does not correspond to a recognized code point? It's called "read-char-by-name", so the intention is pretty clear: it should return a char. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 18:40:52 2012 Received: (at 13177) by debbugs.gnu.org; 15 Dec 2012 23:40:53 +0000 Received: from localhost ([127.0.0.1]:44469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk1Lg-000355-Ju for submit@debbugs.gnu.org; Sat, 15 Dec 2012 18:40:52 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:24156) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk1Lc-00034w-Uw for 13177@debbugs.gnu.org; Sat, 15 Dec 2012 18:40:49 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBFNdcTU001380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 15 Dec 2012 23:39:39 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBFNdbTV029456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 23:39:38 GMT Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBFNdbp7000671; Sat, 15 Dec 2012 17:39:37 -0600 Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 15 Dec 2012 15:39:37 -0800 From: "Drew Adams" To: "'Stefan Monnier'" References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com><8762431shy.fsf@mail.jurta.org><9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> Subject: RE: bug#13177: 24.3.50; doc of `read-char-by-name' Date: Sat, 15 Dec 2012 15:39:29 -0800 Message-ID: <156AF208FCA440DDB10CA4CFBF2815AF@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac3bGr4v5A/KkqxERp2cPzuMhZZcKAAAivgA X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13177 Cc: 'Juri Linkov' , 13177@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.5 (-) > > The problem for me is that I don't know what the intention (design) > > was or why. Maybe someone has a good reason to return nil or to > > return a number that does not correspond to a recognized code point? > > It's called "read-char-by-name", so the intention is pretty clear: it > should return a char. 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. So we start with a code bug - make sure it always returns a char. Then we fix the doc. However, this function has been around for a while, so there might be some code that expects it to sometimes return nil or sometimes a non code-point number. Hopefully, any code expecting nil is only trying to workaround this same bug... Anyway, FWIW you've got my vote in favor of fixing the code to always return a char. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 16 04:35:02 2012 Received: (at 13177) by debbugs.gnu.org; 16 Dec 2012 09:35:02 +0000 Received: from localhost ([127.0.0.1]:44649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkAcf-0007zE-U1 for submit@debbugs.gnu.org; Sun, 16 Dec 2012 04:35:02 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:39413 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkAcd-0007yj-4H for 13177@debbugs.gnu.org; Sun, 16 Dec 2012 04:35:00 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D16F5451E1C8; Sun, 16 Dec 2012 01:33:48 -0800 (PST) From: Juri Linkov To: "Drew Adams" Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' Organization: JURTA References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> <9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> <156AF208FCA440DDB10CA4CFBF2815AF@us.oracle.com> Date: Sun, 16 Dec 2012 11:12:04 +0200 In-Reply-To: <156AF208FCA440DDB10CA4CFBF2815AF@us.oracle.com> (Drew Adams's message of "Sat, 15 Dec 2012 15:39:29 -0800") Message-ID: <8738z6r8pj.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org, 'Stefan Monnier' X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > 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. Try to eval (insert-char (read-char)) and type `C-SPC'. It inserts the character ^@ with the value 0. Typing `C-M-SPC' reports: (wrong-type-argument characterp 134217728) Clicking a mouse button reports in the echo area: "Non-character input-event" This exhibits three different types of error processing for invalid characters. I think that displaying "Non-character input-event" in the echo area is the most reasonable and user-friendly. > 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. So when you type `C-x 8 RET #10r1111111111 RET' it will report in the echo area: "You did not specify a valid character" IMO, this is a sufficient error processing, no? === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2012-12-15 13:07:58 +0000 +++ lisp/international/mule-cmds.el 2012-12-16 09:06:59 +0000 @@ -2944,7 +2944,10 @@ (defun read-char-by-name (prompt) This function also accepts a hexadecimal number of Unicode code point or a number in hash notation, e.g. #o21430 for octal, -#x2318 for hex, or #10r8984 for decimal." +#x2318 for hex, or #10r8984 for decimal. + +When input is neither a known Unicode name nor a hex number +that specifies a valid character, return nil." (let* ((enable-recursive-minibuffers t) (input (completing-read @@ -2953,14 +2956,16 @@ (defun read-char-by-name (prompt) (let ((completion-ignore-case t)) (if (eq action 'metadata) '(metadata (category . unicode-name)) - (complete-with-action action (ucs-names) string pred))))))) - (cond - ((string-match-p "\\`[0-9a-fA-F]+\\'" input) - (string-to-number input 16)) - ((string-match-p "\\`#" input) - (read input)) - (t - (cdr (assoc-string input (ucs-names) t)))))) + (complete-with-action action (ucs-names) string pred)))))) + (character + (cond + ((string-match-p "\\`[0-9a-fA-F]+\\'" input) + (string-to-number input 16)) + ((string-match-p "\\`#" input) + (read input)) + (t + (cdr (assoc-string input (ucs-names) t)))))) + (and (characterp character) character))) (define-obsolete-function-alias 'ucs-insert 'insert-char "24.3") (define-key ctl-x-map "8\r" 'insert-char) From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 16 05:19:24 2012 Received: (at 13177) by debbugs.gnu.org; 16 Dec 2012 10:19:25 +0000 Received: from localhost ([127.0.0.1]:44669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkBJc-0000Xx-M5 for submit@debbugs.gnu.org; Sun, 16 Dec 2012 05:19:24 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:58103) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkBJa-0000Xp-CU for 13177@debbugs.gnu.org; Sun, 16 Dec 2012 05:19:23 -0500 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3YPLzm6dKyz4KK6k; Sun, 16 Dec 2012 11:18:12 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3YPLzm5fftzbbgD; Sun, 16 Dec 2012 11:18:12 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id Xl-6ZiX013Tg; Sun, 16 Dec 2012 11:18:12 +0100 (CET) X-Auth-Info: 9lH/MzesGQnojroTVlodtePY8nvWNcw/lrqY3VB2Nnk= Received: from igel.home (ppp-88-217-116-24.dynamic.mnet-online.de [88.217.116.24]) by mail.mnet-online.de (Postfix) with ESMTPA; Sun, 16 Dec 2012 11:18:12 +0100 (CET) Received: by igel.home (Postfix, from userid 501) id 9B903CA2B2; Sun, 16 Dec 2012 11:18:11 +0100 (CET) From: Andreas Schwab To: Juri Linkov Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> <9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> <156AF208FCA440DDB10CA4CFBF2815AF@us.oracle.com> <8738z6r8pj.fsf@mail.jurta.org> X-Yow: Okay, BARBRA STREISAND, I recognize you now!! Also EFREM ZIMBALIST, JUNIOR!! And BEAUMONT NEWHALL!! Everybody into th' BATHROOM! Date: Sun, 16 Dec 2012 11:18:11 +0100 In-Reply-To: <8738z6r8pj.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 16 Dec 2012 11:12:04 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Juri Linkov writes: > Try to eval > > (insert-char (read-char)) > > and type `C-SPC'. It inserts the character ^@ with the value 0. That's the correct value for C-SPC. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 16 06:00:49 2012 Received: (at 13177) by debbugs.gnu.org; 16 Dec 2012 11:00:49 +0000 Received: from localhost ([127.0.0.1]:44713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkBxg-0001T0-IE for submit@debbugs.gnu.org; Sun, 16 Dec 2012 06:00:49 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:45762 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkBxe-0001Ss-7j for 13177@debbugs.gnu.org; Sun, 16 Dec 2012 06:00:47 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 94677451E1F8; Sun, 16 Dec 2012 02:59:35 -0800 (PST) From: Juri Linkov To: Andreas Schwab Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' Organization: JURTA References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> <9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> <156AF208FCA440DDB10CA4CFBF2815AF@us.oracle.com> <8738z6r8pj.fsf@mail.jurta.org> Date: Sun, 16 Dec 2012 12:49:49 +0200 In-Reply-To: (Andreas Schwab's message of "Sun, 16 Dec 2012 11:18:11 +0100") Message-ID: <87wqwijmpe.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) >> (insert-char (read-char)) >> >> and type `C-SPC'. It inserts the character ^@ with the value 0. > > That's the correct value for C-SPC. Yes, I was confused by the docstring of `read-char' that says: If the character has modifiers, they are resolved and reflected to the character code if possible (e.g. C-SPC -> 0). But nevertheless `read-char' can return non-characters numbers unacceptable for `insert-char'. Currently `read-char-by-name' does the same. e.g.: M-: (insert-char (read-char)) RET C-M-SPC reports: (wrong-type-argument characterp 134217728) and M-: (insert-char (read-char-by-name "Insert character (Unicode name or hex): ")) RET #x8000000 RET reports the same: (wrong-type-argument characterp 134217728) So we are trying to fix a non-problem. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 16 11:32:47 2012 Received: (at 13177) by debbugs.gnu.org; 16 Dec 2012 16:32:47 +0000 Received: from localhost ([127.0.0.1]:45437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkH8t-0001Q9-Mu for submit@debbugs.gnu.org; Sun, 16 Dec 2012 11:32:46 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:41791) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkH8r-0001Pz-6W for 13177@debbugs.gnu.org; Sun, 16 Dec 2012 11:32:42 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBGGVTkx003731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 16 Dec 2012 16:31:30 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBGGVSY3005532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Dec 2012 16:31:29 GMT Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBGGVStH018454; Sun, 16 Dec 2012 10:31:28 -0600 Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 16 Dec 2012 08:31:28 -0800 From: "Drew Adams" To: "'Juri Linkov'" References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com><8762431shy.fsf@mail.jurta.org><9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com><156AF208FCA440DDB10CA4CFBF2815AF@us.oracle.com> <8738z6r8pj.fsf@mail.jurta.org> Subject: RE: bug#13177: 24.3.50; doc of `read-char-by-name' Date: Sun, 16 Dec 2012 08:31:18 -0800 Message-ID: <30C2FE288AE34DC698FA04B884D98FB3@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <8738z6r8pj.fsf@mail.jurta.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac3bcHWiFMLmjNp+QXazWzgtlu/JZQAOZtNw X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org, 'Stefan Monnier' X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.5 (-) > > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 16 11:35:37 2012 Received: (at 13177) by debbugs.gnu.org; 16 Dec 2012 16:35:37 +0000 Received: from localhost ([127.0.0.1]:45442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkHBg-0001UG-U9 for submit@debbugs.gnu.org; Sun, 16 Dec 2012 11:35:37 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:39084) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkHBf-0001UA-Kn for 13177@debbugs.gnu.org; Sun, 16 Dec 2012 11:35:36 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBGGYOxI005108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 16 Dec 2012 16:34:25 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBGGYNMQ000389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Dec 2012 16:34:24 GMT Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBGGYNGD019437; Sun, 16 Dec 2012 10:34:23 -0600 Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 16 Dec 2012 08:34:23 -0800 From: "Drew Adams" To: "'Juri Linkov'" , "'Andreas Schwab'" References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com><8762431shy.fsf@mail.jurta.org><9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com><156AF208FCA440DDB10CA4CFBF2815AF@us.oracle.com><8738z6r8pj.fsf@mail.jurta.org> <87wqwijmpe.fsf@mail.jurta.org> Subject: RE: bug#13177: 24.3.50; doc of `read-char-by-name' Date: Sun, 16 Dec 2012 08:34:13 -0800 Message-ID: <2B9D7E00D0DF4061891D874401E98D48@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87wqwijmpe.fsf@mail.jurta.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac3bfHDj1jePtUq0SXSAKwiZv7oTZwALpwnQ X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) > M-: (insert-char (read-char)) RET C-M-SPC > reports: > (wrong-type-argument characterp 134217728) > > So we are trying to fix a non-problem. No. Let's please concentrate on `read-char-by-name', not `read-char'. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 17 04:43:27 2012 Received: (at control) by debbugs.gnu.org; 17 Dec 2012 09:43:27 +0000 Received: from localhost ([127.0.0.1]:46549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkXEM-0000sc-3d for submit@debbugs.gnu.org; Mon, 17 Dec 2012 04:43:27 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:50202 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkXEH-0000sK-Ch for control@debbugs.gnu.org; Mon, 17 Dec 2012 04:43:23 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 28B5C451E1C7 for ; Mon, 17 Dec 2012 01:42:05 -0800 (PST) From: Juri Linkov To: control@debbugs.gnu.org Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' Organization: JURTA References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> <9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> <156AF208FCA440DDB10CA4CFBF2815AF@us.oracle.com> <8738z6r8pj.fsf@mail.jurta.org> <30C2FE288AE34DC698FA04B884D98FB3@us.oracle.com> Date: Mon, 17 Dec 2012 11:30:30 +0200 In-Reply-To: <30C2FE288AE34DC698FA04B884D98FB3@us.oracle.com> (Drew Adams's message of "Sun, 16 Dec 2012 08:31:18 -0800") Message-ID: <87fw3511cu.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) forcemerge 13177 13195 stop From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 21 02:54:16 2012 Received: (at 13177) by debbugs.gnu.org; 21 Dec 2012 07:54:16 +0000 Received: from localhost ([127.0.0.1]:53396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlxQt-0002UV-Ut for submit@debbugs.gnu.org; Fri, 21 Dec 2012 02:54:16 -0500 Received: from mail-pb0-f43.google.com ([209.85.160.43]:57792) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlxQo-0002UL-UW for 13177@debbugs.gnu.org; Fri, 21 Dec 2012 02:54:12 -0500 Received: by mail-pb0-f43.google.com with SMTP id um15so2558602pbc.30 for <13177@debbugs.gnu.org>; Thu, 20 Dec 2012 23:53:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=YlATqVYORUYStI43NcMJd3Bws9RM+IacuDukX3tHlTs=; b=GWX3w7Ltj7TetP6wz5LcVIyJM0HoC4v6jeXFwYCp7MeMt7e9PoX28lpWriwJtH+kxP QruTgQLOOI+82ffY5mm3Z5KUZbxfLlZmzYcyebv596wyIWhsse/I9suUWyyR5EgYZske 9wlvsksCxm+OqzhmlhOAy0h0RxOa49CDgEjdVDz8l1adqDPYkKCxgt6t5/yTbgTu0l6c tOf3Fu3qsLbDS+PmY5iDKgfeMawthJWbJGiFcp2dRHIVv08mMDYsIiF1roiNto2QvVXB t7zjTCGgTzS/7rOcasCiQ7XjlMQLqbtxVgcR9tNP45r++ujehjFNvwagqJuW6eWtP3Gy mxxA== X-Received: by 10.68.143.41 with SMTP id sb9mr37655786pbb.50.1356076436930; Thu, 20 Dec 2012 23:53:56 -0800 (PST) Received: from ulysses ([155.69.18.203]) by mx.google.com with ESMTPS id d8sm6938021pax.23.2012.12.20.23.53.53 (version=SSLv3 cipher=OTHER); Thu, 20 Dec 2012 23:53:55 -0800 (PST) From: Chong Yidong To: Stefan Monnier Subject: Re: bug#13177: 24.3.50; doc of `read-char-by-name' References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com> <8762431shy.fsf@mail.jurta.org> <9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> Date: Fri, 21 Dec 2012 15:53:50 +0800 In-Reply-To: (Stefan Monnier's message of "Sat, 15 Dec 2012 18:20:13 -0500") Message-ID: <87d2y32641.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Stefan Monnier writes: >> The problem for me is that I don't know what the intention (design) >> was or why. Maybe someone has a good reason to return nil or to >> return a number that does not correspond to a recognized code point? > > It's called "read-char-by-name", so the intention is pretty clear: it > should return a char. Agreed. I changed read-char-by-name on the trunk to signal an error for invalid input. (This also avoids other wonky cases, e.g. entering ## giving the empty symbol because `read-char-by-name' uses `read'...) From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 21 02:54:38 2012 Received: (at control) by debbugs.gnu.org; 21 Dec 2012 07:54:38 +0000 Received: from localhost ([127.0.0.1]:53399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlxRE-0002V4-Nj for submit@debbugs.gnu.org; Fri, 21 Dec 2012 02:54:37 -0500 Received: from mail-da0-f45.google.com ([209.85.210.45]:51641) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlxRC-0002Uy-N7 for control@debbugs.gnu.org; Fri, 21 Dec 2012 02:54:35 -0500 Received: by mail-da0-f45.google.com with SMTP id w4so1948140dam.18 for ; Thu, 20 Dec 2012 23:54:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:date:message-id:mime-version :content-type; bh=eaFntMrKBvNH149Qz/RqeFwq+O9oOEhLlwoRCBBC36g=; b=Wb2InsYe7ZL4OqsPqiWjCZuxH0mOB2hjcNfSMwHB1fICUnM9J4PlmovlLSoTGAbeV/ 6n0yIwVxziAUNRw0TqMjfigC760z5f8+17gWKb1F6+5wuXmJd6tvRiTKPdD/uXJBAkgs QwTSvQtnOY5/CzIaI59NAN7eGvFKMr8qjAjxRYYyge1IuJDS2j+8LEm5xvEgSQIYgW3O 1nqxBkyB5iBNjcs0LC99GtmNP49q3bDm3PumxWxDctedn0a+s469l3HDBNdmLIOinWcE Go8BsuaM0Gvcdxr66x44/t3pzrqe7s1XIljShH2P2HHqaW87c+Nr38Uo221xAyoYemIa gSew== X-Received: by 10.68.225.101 with SMTP id rj5mr37711652pbc.66.1356076461924; Thu, 20 Dec 2012 23:54:21 -0800 (PST) Received: from ulysses ([155.69.18.203]) by mx.google.com with ESMTPS id o6sm6932678paw.37.2012.12.20.23.54.19 (version=SSLv3 cipher=OTHER); Thu, 20 Dec 2012 23:54:20 -0800 (PST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 13177 Date: Fri, 21 Dec 2012 15:54:16 +0800 Message-ID: <87y5grq1qv.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) close 13177 thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 21 03:05:12 2012 Received: (at 13177) by debbugs.gnu.org; 21 Dec 2012 08:05:12 +0000 Received: from localhost ([127.0.0.1]:53430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlxbS-0003f8-Tg for submit@debbugs.gnu.org; Fri, 21 Dec 2012 03:05:12 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:25471) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlxbQ-0003f0-8N for 13177@debbugs.gnu.org; Fri, 21 Dec 2012 03:05:09 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBL84sER032743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 21 Dec 2012 08:04:54 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBL84rkx000761 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Dec 2012 08:04:53 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBL84ra7012812; Fri, 21 Dec 2012 02:04:53 -0600 Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 21 Dec 2012 00:04:52 -0800 From: "Drew Adams" To: "'Chong Yidong'" , "'Stefan Monnier'" References: <4AF22BD1F38E4AF2A650D1F537B47069@us.oracle.com><8762431shy.fsf@mail.jurta.org><9D74DAC118B44C3DAF75A8CFC6AE7FB3@us.oracle.com> <87d2y32641.fsf@gnu.org> Subject: RE: bug#13177: 24.3.50; doc of `read-char-by-name' Date: Fri, 21 Dec 2012 00:04:50 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87d2y32641.fsf@gnu.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac3fUFWXTybrbUqmSSSfTp3mkcR3kAAAFcLA X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 13177 Cc: 13177@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.5 (-) > > It's called "read-char-by-name", so the intention is pretty > > clear: it should return a char. > > Agreed. I changed read-char-by-name on the trunk to signal > an error for invalid input. (This also avoids other wonky cases, > e.g. entering ## giving the empty symbol because `read-char-by-name' > uses `read'...) I don't understand why you did that, if you agree with Stefan. He proposed making `completing-read' require input that represents a valid char. Why let `completing-read' accept invalid input and then raise an error saying the input is invalid? Sorry, I don't get it - seems not very helpful. The function should require the user to provide matching input (name or valid code) or use `C-g' or `C-]' to cancel reading. From unknown Sun Jun 22 08:00:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 18 Jan 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator