From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Moving kbd to subr.el Date: Fri, 15 Oct 2021 09:32:05 -0400 Message-ID: References: <20211004081724.6281.11798@vcs0.savannah.gnu.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> <83y26uilww.fsf@gnu.org> <87pms6wmh5.fsf@igel.home> <874k9i4ghl.fsf@gnus.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="28847"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Andreas Schwab , Eli Zaretskii , stefan@marxist.se, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 15 15:34:08 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 1mbNLc-0007Fw-6n for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Oct 2021 15:34:08 +0200 Original-Received: from localhost ([::1]:47540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbNLa-00030f-4i for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Oct 2021 09:34:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbNJn-0001J8-VJ for emacs-devel@gnu.org; Fri, 15 Oct 2021 09:32:16 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36227) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbNJk-0008AU-8N; Fri, 15 Oct 2021 09:32:14 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9D0D6100321; Fri, 15 Oct 2021 09:32:08 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C0FE61001C4; Fri, 15 Oct 2021 09:32:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1634304726; bh=pGFAHi1gGDuhcFICGg6rrUOUDk+wpaPFE21DSlLEEqw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=IjoyeSf4l8+8N5pNUdzZpE5kCtTGwBK8Lxp/IZQCyWbd+yA4bymkSNkFwIKathJ/P p4Rxzhp882YLE3T6cV8OEDtA6MY7aIlUA4XnUbuvP9bKD3vqmCEKFv5O9arA45lh8V dkmK9TVn9yweIbmjvF2LasASQK8slK56ZY5GgfhzoCPZqEN7rU0ie0A6uqXsChP8u3 ISQc/EUYkYsQSmE0QsacIfogEGILR7upcTew/d9ZTkHv2yshoT+lBj+Z3n2MlCSEMH 8BGtunzJ3ptAzoLHLMhUv201lY2jrUmBjS6Jp8lToy4vuGH6rxEziZr28eEv3YKqC7 +MnWSHowriGwg== Original-Received: from pastel (unknown [45.72.241.23]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 78E6B120211; Fri, 15 Oct 2021 09:32:06 -0400 (EDT) In-Reply-To: <874k9i4ghl.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 15 Oct 2021 14:31:02 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-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:277122 Archived-At: > commit 629d4dcd2a184da6a0b246d31f152a84327db51a > Author: Richard M. Stallman > AuthorDate: Tue Sep 21 03:44:04 1993 +0000 > > Total rewrite by Gillespie. > > + always (and (integerp ch) > + (let ((ch2 (logand ch (lognot (lsh 1 23))))) > + (and (>= ch2 0) (<= ch2 127)))))) > > which works as intended (probably), and then it became First things first: I think `kbd` should simply always return a vector. [ This is just repeating my stance that we should deprecate the use of strings as sequences of events. ] As for what this intends to do, I think it tries to use a string even in the case where some of the events use the `meta` modifier, and it does this by relying on the following bit of code in `define-key`: int meta_bit = (VECTORP (key) || (STRINGP (key) && STRING_MULTIBYTE (key)) ? meta_modifier : 0x80); I.e. when a string is used to represent a sequence of events, that string can include meta modifiers (represented as the 7th bit) but only if the string is unibyte. It's for those kinds of intricacies that I want to get rid of the use of strings as sequences of events. Stefan