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 11:12:36 +0300 Message-ID: <83tub173wr.fsf@gnu.org> 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> <87pmlql6mj.fsf@yahoo.com> <83fsmm8h0n.fsf@gnu.org> <87bkx9kb7d.fsf@yahoo.com> <83zgkt79ia.fsf@gnu.org> <87ilrhfoch.fsf@yahoo.com> <83v8vh77lq.fsf@gnu.org> <87wnfxcrt1.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1820"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 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 10:13:37 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 1ndShU-0000Ky-IH for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 10:13:36 +0200 Original-Received: from localhost ([::1]:52736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndShT-0005Xc-38 for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Apr 2022 04:13:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndSgZ-0004rM-IS for emacs-devel@gnu.org; Sun, 10 Apr 2022 04:12:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndSgZ-0004Y7-8p; Sun, 10 Apr 2022 04:12:39 -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=UIV4eDwhdCVJaOH48BWdovYcGf79x3IkNpav9gJo0wU=; b=I+RG4sG+hjq/ oL9EG3wpe1Bp4LnpCVZvZCmVLndAzoWhURvJXA/fHmOkGZTSW0Khs3z4NC4LcxYcBGJcEqDxqF/iP J8RTQKoIZRq6sTp7eMeJaYWrBoXzEz76Qq+pZ6RDj//1lW+Nrmu7GpkqAGqoamEtieS2BGtUkxgtk LcX61vADbidr760IDzfJ2GCC5A/jqH+sFlDZ1RiZh6bRV4KjxmcTZoXnv81zIoCj706ZxjsgIs4ky W8UnHu8F0jnAKpdAlJNCOotoEv0kKEAeqhXARYq/uGU6L7GadCJhkdAjpc/3LDJtc92nrFhQFMYqE fe4NwlMliDRLKvue+B2PlQ==; Original-Received: from [87.69.77.57] (port=1968 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 1ndSgY-0000gR-P9; Sun, 10 Apr 2022 04:12:39 -0400 In-Reply-To: <87wnfxcrt1.fsf@yahoo.com> (message from Po Lu on Sun, 10 Apr 2022 15:37:30 +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:288114 Archived-At: > From: Po Lu > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Sun, 10 Apr 2022 15:37:30 +0800 > > Eli Zaretskii writes: > > > We have this in many places in Emacs already, so adding one more will > > not hurt too much. Dispatch on the first element of the list is easy > > and produces code that is quite readable and maintainable, IMO. > > > > Of course, if more elegant ways exist, I don't object to using them, > > quite the contrary. But if not, I see nothing especially wrong with > > doing what you call "very confusing", because we do it elsewhere. > > Hmm, do we use keywords anywhere inside Lisp events? If not, then > here's a simple way to add a property list to the end of event lists: > > (defun event-plist (event) > "Return the property list of EVENT." > (while (and event (not (keywordp (car event)))) > (setq event (cdr event))) > event) > > Then, additional information could just be added to the end of each > event by appending any property list that associates keywords. It's possible. But using ordered lists is also OK. Having keyword/value pairs would probably call for a new kind of event list, so that applications could know whether to use indexed access or keyword-based access.