From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Moving kbd to subr.el Date: Fri, 15 Oct 2021 13:26:30 +0200 Message-ID: <87ee8m4jh5.fsf@gnus.org> References: <20211004081724.6281.11798@vcs0.savannah.gnu.org> <87o87ubcnl.fsf@gnus.org> <87h7dm9en7.fsf@gnus.org> <87czoa9e7p.fsf@gnus.org> <878ryxakv9.fsf@gnus.org> <834k9km5no.fsf@gnu.org> <83k0iflsze.fsf@gnu.org> <874k9jzu7a.fsf@gnus.org> <874k9juy0r.fsf@gnus.org> <87mtnbtimj.fsf@gnus.org> <87wnme4m6f.fsf@gnus.org> <83zgraim4f.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15805"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: stefankangas@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 15 13:27:31 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbLN4-0003tk-W7 for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Oct 2021 13:27:31 +0200 Original-Received: from localhost ([::1]:35622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbLN2-0005kM-L7 for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Oct 2021 07:27:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbLMF-00050r-KJ for emacs-devel@gnu.org; Fri, 15 Oct 2021 07:26:39 -0400 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:37328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbLME-0007zG-5j; Fri, 15 Oct 2021 07:26:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uSUp5YCayKgkQ8bszKKE+KSD3vPp015o7TYH5zGEZDw=; b=R4xBsAmxVli9bi64e3RG6lqejb cWn1RqmzVjxlHMHJgszGozPkE1KeWzLF4eLPPkOHO0e/FKQS0OGJL2L32J77ze+Po/VEjzXPEqR8Q hQJ7hUPN+fKQQe+Rtx11H/B1/P8M3b7cTo6t3+jIIkVwv3DevaQ1WxBGEAz/0Smyj/CI=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbLM6-00040u-V1; Fri, 15 Oct 2021 13:26:33 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXn18e4j2uVUy1H Jhz///91B/UdAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UKDwsRJPsBAEYAAAGKSURBVDjLXZOBkSwh CER1fgLqJTBiAifkn9s1yCL7p2q3Rt/YNAil1Nl7iedHRNp5rT2Bin3hC/wp5Z8CeQ+AVMtKItve nx5atUgGc5pO0983SMEPmAEixhJeIiVA7RGcaO0LhsvCLhElQMvTffSEJ/hQ71MymBdQAAZoFzRf VVgiKheUQeZraBIzwOwVAEfqiCQczGdp+pXoU3MDcP4jjCMdIJ9AEhDnhkiRkDlkOVEPeDPow4pN CnYAqHS4YWoAKQjAOxiAHbQLml41w4Jp/ZZPpflZGewLxsY2yxymxSGFGxBS8HxFVyCLgGbFJzdF APWK/+3g/QYLqWMXWvsmKKIZak2EwxcAWTdR04IqYAfQESuJXUikqI0h6mj6TZFHN6nfOoYuVYfo 00qCRhxnCXNI1oeCNQJMGkCxiDOQAAjjgA6wpZXRWzFA85b5zAEKlAYsaRnQzO1IXzHPB3Rb1t15 jj38hFZXG2jr/KPvWslANWz+efnUOtBOeSUZPEC6Btn/A/d7Abb/AKXNawxsTLkvAAAAJXRFWHRk YXRlOmNyZWF0ZQAyMDIxLTEwLTE1VDExOjE3OjM2KzAwOjAwDbjhsgAAACV0RVh0ZGF0ZTptb2Rp ZnkAMjAyMS0xMC0xNVQxMToxNzozNiswMDowMHzlWQ4AAAAASUVORK5CYII= X-Now-Playing: Everything But The Girl's _Amplified Heart_: "Missing" In-Reply-To: <83zgraim4f.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 15 Oct 2021 14:05:36 +0300") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:277108 Archived-At: Eli Zaretskii writes: > The code deals with character codepoints, not with their multibyte > representation. So UTF-8 or not doesn't seem relevant here. Sorry; I mean "Unicode code points", not utf-8. Eli Zaretskii writes: >> > > always (and (characterp ch) >> > > (let ((ch2 (logand ch (lognot ?\M-\^@)))) >> > > (and (>= ch2 0) (<= ch2 127)))))) [...] > Actually, I have to disagree with the conclusion that this is a > complicated way of saying > > (<= 0 ch 127) > > That's because 'ch' can include modifier bits set, and the above code > resets them before comparing against 127. But `characterp' just checks that ch is smaller than 0x3FFFFF, and (dotimes (ch #x3FFFFF) (unless (equal (and (characterp ch) (let ((ch2 (logand ch (lognot ?\M-\^@)))) (and (>= ch2 0) (<= ch2 127)))) (<= 0 ch 127)) (error "%s" ch))) shows no difference between the two tests in that range. So perhaps the logic it's trying to get at just doesn't work, or we have other problems here. And note: (characterp ?\M-\^@) => nil It's hard to say, but I think the code wants to allow returning "\M-s" as a string, but it doesn't: (edmacro-parse-keys "M-s") => [134217843] So the code today is equivalent to (<= 0 ch 127), but that's probably because it's buggy -- perhaps always has been, but perhaps it's because we've changed how characters are represented. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no