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: master 3b41141708: Expose the name of an event's input device to Lisp Date: Sat, 09 Apr 2022 09:31:29 -0400 Message-ID: References: <164933858147.29834.15050766441005536059@vcs2.savannah.gnu.org> <20220407133623.9C209C009A8@vcs2.savannah.gnu.org> <87ee28xyg2.fsf@yahoo.com> <87lewfqf1q.fsf@yahoo.com> <87zgkvosia.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24298"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 09 15:32:54 2022 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 1ndBCu-00064G-MB for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Apr 2022 15:32:52 +0200 Original-Received: from localhost ([::1]:57656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndBCt-0000DD-HM for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Apr 2022 09:32:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndBBm-0007qS-Td for emacs-devel@gnu.org; Sat, 09 Apr 2022 09:31:42 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndBBk-00022l-8V for emacs-devel@gnu.org; Sat, 09 Apr 2022 09:31:41 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DC18A1001D2; Sat, 9 Apr 2022 09:31:37 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6C029100134; Sat, 9 Apr 2022 09:31:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1649511096; bh=esG2R3kPQlInovprbyBk5OHbWfoKqj3KL6CyvPNzdjE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=IH4jeCeS1osNU4eeQvxB7oRQl9ZD8/7th6AVNDQ83HQZLbz4n3rRMYbx7mlHSQu9O dSImSUxDC4/S8OkB7kFPD3iYq0Qm2XK6dIugnRqKsfjZah9SiCNsDNMGNTP0Trd+en OiZUXsoqAYDV/9A80AmGB5jTlQhBGnvUqfCsuCT3TaZ8zISvsxkLyKRCbxmbSOUK+o u7uoeQ80Y13F1PEhHf3SpGGJ6Zs/MPURgFWthdEwhS9NWJ9BhtK/itKsXznPOksHoF CtV/hyrvjaWQVG0qqeKn4fGqDAFmK4xOgdTloUvrMn0EL9oe+Bul3yevRO8QJUPQaq VpjnL5ZMydbaA== Original-Received: from alfajor (modemcable034.207-20-96.mc.videotron.ca [96.20.207.34]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2FE6312051F; Sat, 9 Apr 2022 09:31:36 -0400 (EDT) In-Reply-To: <87zgkvosia.fsf@yahoo.com> (Po Lu's message of "Sat, 09 Apr 2022 11:17:01 +0800") 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:288023 Archived-At: Po Lu [2022-04-09 11:17:01] wrote: > Stefan Monnier writes: >> We could put it in the "posn" thingy, but at the same time it's not >> really a "posn" and it's kinda weird to duplicate it into the start and >> the end posn of an event. It would be better to associate it with the >> event itself and have an `event-device` function to access it. > But wouldn't that mean the `event-device' function would have to have a > specific implementation for each kind of event, with different indexes > passed to `nth', since we can only add information to the end of each > event? Not necessarily, it could be something like: (defun event-device (e) (when (consp e) (alist-get 'device (nthcdr 3 e)))) But I agree that the current representation of events is problematic. We should make it more regular and self-descriptive, either based on an alist as above or have every event come with some kind of "class" which then describes the name&position of every accompanying data. Stefan