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: Sun, 10 Apr 2022 11:16:00 -0400 Message-ID: References: <164933858147.29834.15050766441005536059@vcs2.savannah.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> <83lewd70wz.fsf@gnu.org> <87sfqlb88e.fsf@yahoo.com> <877d7xb35v.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="25661"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , larsi@gnus.org, 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 17:16:45 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 1ndZIz-0006QS-1k for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 17:16:45 +0200 Original-Received: from localhost ([::1]:40570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndZIx-0007s4-JW for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 11:16:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndZIP-0007C8-Ga for emacs-devel@gnu.org; Sun, 10 Apr 2022 11:16:09 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndZIL-0000fj-HF; Sun, 10 Apr 2022 11:16:08 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7D1ED1001E0; Sun, 10 Apr 2022 11:16:03 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 17B1810012E; Sun, 10 Apr 2022 11:16:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1649603762; bh=FbcHYHfA8y2m+L+tYOgb+XQwdtA/YvoWob00KG0eo9E=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ibi6udUUxYmS35hwAHx+RYcN0Wox/2tJQ0je4vk1qkxIb8yzYiQW0vnK2wvf/VQCi UdzJ8QrKj9/smXKv1dhiC8s98d6YFJ6B4T+lTJOWV+qvKyqmZaA2VEc1Dz4vcXXL5I 19GTFlx/LAuXEpWnFphE7jwhfmSF6+y8zNH3D/J20By+tppAoB4mLwCKqQkoBEdHGw uQ1zNA5da7/azKwGQ53BEATA3xbt0I9GlQxZA9vTuqjLiSXhmqevsdd/dJB2aMwSBn Fd32UuL7K+OUv1wGcMnLAoXsbkvnR3Gc0SoWGWoXpMP1LYAcbznfKxASiSKd3Cn3xQ TeWmJJwXdMQvQ== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D52BC12023B; Sun, 10 Apr 2022 11:16:01 -0400 (EDT) In-Reply-To: <877d7xb35v.fsf@yahoo.com> (Po Lu's message of "Sun, 10 Apr 2022 19:15:08 +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:288148 Archived-At: > `register-device-function-key' takes a device or device class, and a > recommended function key. If no function key was previously registered > for that device, it associates the function key with the device. > Otherwise, it returns the function key that was previously registered. That means all users of `register-device-function-key` need to write their code under the assumption that the actual "function key" (I'd call it a "prefix event" rather than a "function key") is not the one they asked for but the one returned, which ends up being the same as dynamically-generated "function keys". It makes it rather inconvenient to use for the end user who wants to (define-key map [foot-pedal ?b] 'foo) and has to do (define-key map (vector (register-device-function-key ) ?b) 'foo) instead. I hope we will settle over time on some naming convention so that conflicting names almost never happen and `register-device-function-key` can presume the caller knows what it does, so instead of returning the previously chosen name, it doesn't return anything and overrides the old name instead. Stefan