From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp Date: Sun, 10 Apr 2022 12:17:16 +0300 Message-ID: <83lewd70wz.fsf@gnu.org> References: <164933858147.29834.15050766441005536059@vcs2.savannah.gnu.org> <87tub4uivu.fsf@yahoo.com> <83y20fakwn.fsf@gnu.org> <87o81bu7zj.fsf@yahoo.com> <83v8vjai4s.fsf@gnu.org> <87bkxbsqfl.fsf@yahoo.com> <835yniah0u.fsf@gnu.org> <8735impqw4.fsf@yahoo.com> <83v8vi8uyu.fsf@gnu.org> <871qy6o9p3.fsf@yahoo.com> <83o81a8qnd.fsf@gnu.org> <87zgkulbuu.fsf@yahoo.com> <83ilri8iag.fsf@gnu.org> <87k0by43an.fsf@gnus.org> <87bkx9lqno.fsf@yahoo.com> <8335il8p4c.fsf@gnu.org> <874k31h3kz.fsf@yahoo.com> <83y20d7808.fsf@gnu.org> <875ynhe6mx.fsf@yahoo.com> <83r165735n.fsf@gnu.org> <8735ilcof3.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28358"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, monnier@iro.umontreal.ca, rms@gnu.org, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 10 11:19:20 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 1ndTj6-00079L-Ig for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 11:19:20 +0200 Original-Received: from localhost ([::1]:58826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndTj5-0004ZK-BW for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 05:19:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndTh8-0003Aj-9x for emacs-devel@gnu.org; Sun, 10 Apr 2022 05:17:18 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndTh8-0005JW-0Q; Sun, 10 Apr 2022 05:17:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VwzYhxusGpc2jGt09o9/XY87tlLdaOS9OCzzFkn38Ac=; b=LNRn6g8Irz2P Vm7p4vbY9TdvZcP87GaETkMFjU4w6eK+6OL4+tNsbYrTMyCqu56+RY8iOf23rmphj0dM6mqMV2uyE XIcHHFNK2x3hme6JeXx+UKUZDq5b6BNcvTja5UgErs6noh8u1nmoCVhQVJQlpH/bLnMPPsJMJScnd hL8gnjyLng8mQaTbOBo6o11cozWi19Ydnwpm2gHu4QJQiv3LZc058dWZcUnIW+jiTDB4j2xzxAM1P FeIOhI2rplfgZ/AA2RcHfGKhdQ0u2fufZpeVvmULCm0/w4Bzs7e9HjbkLOs/zrOr+xjAQcJkTEGT5 48VfEttCoeVupgeq1Lihpw==; Original-Received: from [87.69.77.57] (port=2011 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndTh6-0007df-T4; Sun, 10 Apr 2022 05:17:17 -0400 In-Reply-To: <8735ilcof3.fsf@yahoo.com> (message from Po Lu on Sun, 10 Apr 2022 16:50:40 +0800) 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:288123 Archived-At: > From: Po Lu > Cc: larsi@gnus.org, emacs-devel@gnu.org, monnier@iro.umontreal.ca, > rms@gnu.org > Date: Sun, 10 Apr 2022 16:50:40 +0800 > > Eli Zaretskii writes: > > > My point is: Emacs should use the information about the device where > > it generates the Lispy event. At that point, we should generate a > > different Lispy event for a device whose events we want to handle > > differently. On the higher levels, the device information should not > > be necessary for processing those Lispy events. > > > > How does my point above contradict the data you show about these two > > devices? > > > I hope my response above explains why I think the need to know the > > device info can and should stop at the level where we produce the > > Lispy event objects. > > Hmm... how about a variable `device-function-key-alist', which maps > device names and classes to the corresponding function key? The low-level code which generates Lispy events can, of course, use some Lisp data structures, including user-defined data structures. > The code to read events could then be changed to add such a function key > when an event is received for the suitable type of device. > > For example, pixel-scroll-precision-mode could add ((class mouse) > . coarse-mouse) to that list, which would make events coming from a > mouse report themselves with the fake function key `coarse-mouse'. Yes, but what does the "class" part in "class mouse" signify? Why not just "mouse"? > Then, the command to scroll with interpolation could be bound to > [coarse-mouse wheel-down]. > > Or Lars could specify ("Name of footpad device" . footpad), and bind the > appropriate commands to [footpad a], [footpad b] and so on? > > WDYT? That's fine, but such a data structure, and/or the API for setting it, should be designed to be "safe", in that users cannot too easily shoot themselves in the foot by making mistakes in their data.