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: Mon, 18 Oct 2021 08:02:14 +0200 Message-ID: <87o87moopl.fsf@gnus.org> References: <20211004081724.6281.11798@vcs0.savannah.gnu.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> <87wnmd13ny.fsf@gnus.org> <87sfx10xs6.fsf@gnus.org> <87h7dfpjn3.fsf@gnus.org> <31b2f1e94178d73e5f05@heytings.org> <87czo3pgs1.fsf@gnus.org> <31b2f1e9412d60db82df@heytings.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="16193"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Stefan Kangas , emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 18 08:03:57 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 1mcLka-0003y9-K2 for ged-emacs-devel@m.gmane-mx.org; Mon, 18 Oct 2021 08:03:56 +0200 Original-Received: from localhost ([::1]:52516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcLkZ-0005ho-BH for ged-emacs-devel@m.gmane-mx.org; Mon, 18 Oct 2021 02:03:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcLjA-0004NA-LB for emacs-devel@gnu.org; Mon, 18 Oct 2021 02:02:28 -0400 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:37716) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcLj8-00075W-4N for emacs-devel@gnu.org; Mon, 18 Oct 2021 02:02:28 -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=GXc7POGX+Fib8e5CIANwwf7oa7ekjtHYeMUjxeCruZU=; b=a+zrbDmXb6EpcDLk2b4TcMxPJF cOjd/vPdqrdwjdcb+rrk17Hyop3e382j01Ux15bRbHxSzIOSCskuJqCpsyeRNd8U9suxg+0qxowfr LAH3eS4sZ0K1J8IgO2ERk+dakdsOU5jbBOqyQp91MQb8YXjKZ5fd1QMH96VG3dNPxrwE=; 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 1mcLj1-0008KP-Fo; Mon, 18 Oct 2021 08:02:21 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEWhtsr15stfkb82 c6heZn////8ZH8eEAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UKEgUvLBzyMUEAAAGrSURBVDjLrZLR eeMwDIMZqgMonoABbwCVvA1u/50K2Mm1Tdy3+sGfzZ8iIEhmn8/16/P975fAzNs52HydA/f6AVhe VLj7/jIq/P0UZKHORs3RMW4nwIHrxOUEdPAVr2A0OA8vYGZLelyegXUJ+AvwQpyB2Uit2J7BqDB5 fRFPlHHMrCewVXczw209gVFJcrvOh8TMA7RW1COpaejewdZawExmwbB/H8CPn6yjVuqzPfFgINno foDagXcOFR5ATUVgQMUd1AFKwOgVln2v7q/QfotnHfa/RmGmw9YOR9g+KnZTMNdMCmQklvMbBfYA zVYOXx5ZAf7wPlRmAsYRhth43KoGtBsnHu8XQjYYy1xZvHPsTw4PXUh3FjZZBCbF03OxGb7RDCWg SbOXlsRYRsfUpMCwyjW5GU5CL1YRDNvL6U4AXeNPS0Quw1MtVCla+Eczh7a2zwqvhIJh5iYBbYvJ luJNHYblW/kBuBfSUoJMycbf3IPUQ1A62USHPNKVh3aQGhiKMnVFdB5Up29uvjN5NgOrZdMUGpvl WfKazJtfi0phFQTmyqnlJKP6A104eYaAaStRAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTEwLTE4 VDA1OjQ3OjQzKzAwOjAwcO6i9wAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMC0xOFQwNTo0Nzo0 MyswMDowMAGzGksAAAAASUVORK5CYII= X-Now-Playing: Brokeback's _Field Recordings From The Cook County Water Table_: "Another Routine Day Breaks" In-Reply-To: <31b2f1e9412d60db82df@heytings.org> (Gregory Heytings's message of "Sun, 17 Oct 2021 21:20:01 +0000") 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:277253 Archived-At: Gregory Heytings writes: > If the point is to introduce a strict syntax, I think it's up to you > to decide which key and event names are okay from the point of view of > Emacs. I imagined that the OS was feeding us the event names somehow (from xkb in X, for instance), but that's perhaps not true? In keyboard.c, we have lispy_accent_keys, lispy_multimedia_keys and lispy_function_keys (etc) that perhaps lists (exhaustively) all the keys we can handle? Let's see... make_lispy_event uses all those... and then /* Handle system-specific or unknown keysyms. We need to use an alist rather than a vector as the cache since we can't make a vector long enough. */ if (NILP (KVAR (current_kboard, system_key_syms))) kset_system_key_syms (current_kboard, Fcons (Qnil, Qnil)); return modify_event_symbol (event->code, event->modifiers, Qfunction_key, KVAR (current_kboard, Vsystem_key_alist), 0, &KVAR (current_kboard, system_key_syms), PTRDIFF_MAX); Which... Uhm, actually, I'm not sure what this returns, since NAME_ALIST_OR_STEM isn't a stem here. Anyway, it seems like we (more or less) have a complete list of all symbols that are possible, but there's no way to ask Emacs "is this a valid lispy event name?" And it depends on the OS -- so we can't really create a function based on the lispy_ C arrays either, because it'd be annoying to get errors (or warnings) on different systems. But it does seem true that none of our events start with a number, or a dash, or an underscore. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no