From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp Date: Sat, 09 Apr 2022 21:37:56 +0800 Message-ID: <87pmlql6mj.fsf@yahoo.com> 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="13772"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 09 15:38:47 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 1ndBId-0003Pd-Pe for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Apr 2022 15:38:47 +0200 Original-Received: from localhost ([::1]:60450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndBIc-0002Rr-5L for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Apr 2022 09:38:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndBI4-0001l9-O5 for emacs-devel@gnu.org; Sat, 09 Apr 2022 09:38:12 -0400 Original-Received: from sonic304-21.consmr.mail.ne1.yahoo.com ([66.163.191.147]:39959) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ndBI2-00038G-Ln for emacs-devel@gnu.org; Sat, 09 Apr 2022 09:38:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1649511487; bh=8QMS70CWwsmgYE8/6X9r85MucW6mveKMuUuJbxFaNTs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=E75qJNfUjlJYlp13G1LwDPjRybDHyqcId/NHUG+OaTbqFR9fP6See0CS1d6armqaa05/IffVoqWfRrDdlYM+JqReb9G99hLkxi24bDyJqMzPXYrejI++xW366lLerZ1l6XYdi6nza6WK2QLQGtjWZfc5crQBn5xyGGdJlpFEZYQeJbuPzizHXEl7BmKqCRbv3ReIrVzxQvjX6xHigHPgmv+AURx7dTCCFr+hXTkDJYHDfLBKCQNXRqMJgaI7qzmkIsC/QRPtXIsc83YwQaa7Iwh5oPWHHEayGahA0D5+VKodII4WQfI2UeWDciUGIV4atHFszU1g0HENnJiNcKfqgw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1649511487; bh=7DTxo2b/88X8YANg9izyuQzNhk7XX0V7ifCIeupfVIk=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=G7k22hC03zI7kPud0KKmtZkeHj4CGOgtsiRP21i4+mYVCacwRHLBLPHh6AkjrkEIxRfTuGZny/aj2GBcwOEaLXb/ZdugBKb+1RtDSsyfXkLoGQh/3QtCZutfJ21L/2eMkdgIdyIbB1uREhjfRb24JZp+giEpo/UxZobQ3OhFKqfgZqb3/cSRq3szq2WSqmDWQ2KAmFIV68oj1sQyPIiDuLpyiM5dZqv7XyajfpeQ3X71HOji8ptkIao4jXA/M/NdUEmRyULFa796ef/8ITRv00OJnJdsfPXTwOB43HiXMWOhWXiBORmU81clAYNwmiMIn7uOjhh1We+WwpB0iByZcA== X-YMail-OSG: 5C0ADWcVM1n4y.r86A3jIWRvad2N1mlzaCfhKVaHEghpyHL6Ah5bUdYR0ADOiwM .A4ZhKLP1lBUOlt1xLkWGHKbm0jGkgYfsGmd_ngkbmxBnZ1Diy9lsgkt48FGMCvhhcxwdmSssvGE oP5WSss7xyyXl4U_leOpOK30Aj3LQmAb7v7jKv0.0Zbj_kbomqp1ts9MS3T3EImf_SdMJVQIKgOi xB9q.Mn7ejuRbsh.vPcOpRnePKQIib2VtyMAOaFdwv9W7v2ITOAB_IDDMfyDNTg_H2ieW2Hq75Cd 7zFMXst5O.RVPgXeENbmiZuTKWkBCC2cNeuLDOLDZ0_AmuS_F41XNWBZflYvY.NJVji69j8YElAj CsRt0gQaDcmLE9Sk9gdp_IRueOX1bwmcO82B.yP6W139KDe2eyBdWBeus5FgJqXiQufWzz_R8oOQ C5zdwaGJth7vuI9qxFOgVB2kxpAJAP56pV60oQCcGCe6uKlxaLqeGgcr_xkbKa1Xfkl4OG5lm9O9 rJbA0Gzcq58z4wnmmt3AMrNcVag24dvP4ERmybyhJHnDxUSk5_IPXTsogC7Jy8va8WluTxTeb7EB urGYJ81Z3DiZE7GKvUcz1W7_13DJNiyNv637bi5_qJUhaMO6RzQlhkROCZoOxCwKPOeks8IRnNec baOObI7Q60G3EveNzTeHirBnQSaJ5QjOhY_T8EAG6x8FbslqxvTUot5Z0ZOv2wOVb9WaMSekk4x3 2rQOGLxFKAc_Xi55.hfP6yHqsOd4P0M4CZ49Rv7u5nC0uZM1..4FkEip_yA0UIk5nLPzVPM8asju ORT7ncdyIFC9OyHCFkSczhBKWkq5gSw2HC4he5T0C9 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Sat, 9 Apr 2022 13:38:07 +0000 Original-Received: by hermes--canary-production-sg3-65d7bd97b5-r89m2 (VZM Hermes SMTP Server) with ESMTPA ID 7b37a11dcd4fb9bb7963c2b1bac3f5ca; Sat, 09 Apr 2022 13:38:02 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Sat, 09 Apr 2022 09:31:29 -0400") X-Mailer: WebService/1.1.20048 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.191.147; envelope-from=luangruo@yahoo.com; helo=sonic304-21.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:288024 Archived-At: Stefan Monnier writes: > 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. Unfortunately, our current representation is basically set in stone. There is too much Lisp out there that relies on the current form of Lisp events, and simply finding all that code will be a serious chore. Maybe we could introduce a new representation of event in addition to the current form, with a its own interactive form and read-event, that represents events as some better data structure? We could then recommend that people use the new form of event, as with `keymap-set' and friends.