From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.bugs Subject: bug#74423: Low level key events Date: Tue, 19 Nov 2024 21:05:06 +0100 Message-ID: <705fabb8-1ea0-4894-8c32-05097ab822c9@imayhem.com> References: <31bdc55d-8c13-4de0-9cef-bd6cc4fb033f@imayhem.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28578"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 74423@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 19 21:06:24 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tDUUS-0007E3-33 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Nov 2024 21:06:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDUU9-00005d-0Z; Tue, 19 Nov 2024 15:06:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tDUU7-00005A-4D for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 15:06:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tDUU6-0005S5-Qn for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 15:06:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=nQsFiORcV14srm7w+5PY3HsJPNep6wbbeyGtVMdap+o=; b=NVnGvy9SDYJd4Iq0KGci40yLvdCOnBsXSrI9IvAIkxapafW8/3coVFEqae1Guc3jlQWkZLGD8lhyuG7C5ilcJUpwjXdwOoLILZiFiHQ61AdaiiCm8H/Zat3pMvt2TEpREfE6NTS1FGesJz1KfSuUIp3AY7YrGPfG8gHvwQ1CfG43QlNZspZUGDCt3Y2GqQqWi5UGihpSdmqd0vHgC30yu5JMZL2aVQtlaDYfWm7I9xfWEujiipQ4PenMJ8/X1o05j1Xkp9pSOOQhukQtUdj/9dnbcvsSFN7Id8uqOEeRDNx2+O1+PQLSJND+Rf8WPQNk7j0byp5oSngcU0a7Y2d1Xw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tDUU6-0007X1-L3 for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 15:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Cecilio Pardo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Nov 2024 20:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74423 X-GNU-PR-Package: emacs Original-Received: via spool by 74423-submit@debbugs.gnu.org id=B74423.173204671828894 (code B ref 74423); Tue, 19 Nov 2024 20:06:02 +0000 Original-Received: (at 74423) by debbugs.gnu.org; 19 Nov 2024 20:05:18 +0000 Original-Received: from localhost ([127.0.0.1]:44132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDUTO-0007Vx-Bv for submit@debbugs.gnu.org; Tue, 19 Nov 2024 15:05:18 -0500 Original-Received: from mail.imayhem.com ([82.223.54.191]:38879 helo=zealous-pike.82-223-54-191.plesk.page) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDUTL-0007VV-QK for 74423@debbugs.gnu.org; Tue, 19 Nov 2024 15:05:17 -0500 Original-Received: from [192.168.68.104] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id BC5C7800F3; Tue, 19 Nov 2024 20:05:08 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.104] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295658 Archived-At: On 19/11/2024 17:43, Stefan Monnier wrote: >> + ((functionp func) (funcall func)) >> + ((eq 'hyper func) >> + (message "H-...") >> + (let ((r (read-event))) >> + (setq unread-command-events >> + (list (event-apply-modifier >> + r 'hyper 24 "H-")))))))))) > > Move that code to a function, so you can get rid of this `hyper` > special case. BTW, any reason why you couldn't use > `event-apply-hyper-modifier`? No, no reason. I will change that. > I think the list of low-level keys handled here should not be hard-coded. > IOW, maybe `enable-low-level-keys` should not be a boolean but > a list/map/table indicating which keys to handle. I was sending the keys for which I have an immediate use case. Using a list looks got, adding some special symbols to choose groups, such as "all modifier keys". > So, IIUC you might generate 2 low-level events for a single key press? > Why? We want to allow to detect modifier keys, regardless of the key that is used. For example, when you press Shift_L we generate an event for 'lshift and other (of different type) for the modifier 'shift. > Other note: in the distant past (back around Emacs-21) I seem to > remember Gerd making changes to the event structure so as to avoid > allocating Lisp objects for this code. I think it was related to > problems due to running this low-level event-handler code from within > a C signal handler, which is a practice was have since stopped, luckily, > but maybe there are still good reasons to try and avoid involving > allocating objects into the Lisp heap in this low-level code. I will look into this. Thanks for your comments!