all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: larsi@gnus.org, monnier@iro.umontreal.ca, rms@gnu.org,
	emacs-devel@gnu.org
Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp
Date: Sun, 10 Apr 2022 09:44:07 +0300	[thread overview]
Message-ID: <83y20d7808.fsf@gnu.org> (raw)
In-Reply-To: <874k31h3kz.fsf@yahoo.com> (message from Po Lu on Sun, 10 Apr 2022 14:09:32 +0800)

> From: Po Lu <luangruo@yahoo.com>
> Cc: larsi@gnus.org,  emacs-devel@gnu.org,  monnier@iro.umontreal.ca,
>   rms@gnu.org
> Date: Sun, 10 Apr 2022 14:09:32 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I think the usual Emacs abstraction centers on the events, not on
> > devices that emitted them.  So we should be able to have devices emit
> > events regardless of the device type/nature/name, and then the usual
> > Emacs machinery of binding commands to key sequence will do the rest,
> > and will do it according to user expectations.
> 
> It seems to me that abstraction was built around text terminals and
> legacy X windows behavior, which changed with the wide adoption of
> multiple instances of different kinds of input devices in X and
> elsewhere.

Slapping a derogatory label on some idea or code doesn't provide any
real content for intelligent and flame-free discussion of the issue.
An idea doesn't magically become invalid by calling it obsolete.
Let's try to avoid such "techniques" of argument as much as possible.

As things stand, I still don't see why keeping our abstraction in this
matter somehow doesn't fit the modern input device technologies.
Please try to explain why it doesn't, by describing practical use
cases where the extant abstractions and infrastructures in Emacs
cannot handle some situations or features, whereas your proposed
design (or some alternative design) can.  So far, every example you
have given can amply be handled by the existing machinery, AFAICT.

> > The key doesn't have to be a device name, it should rather describe
> > the general type of the event/functionality.  For example, all the
> > devices that have foot pedals could emit events that begin with the
> > same pseudo-function key 'foot-pedal'.  Even if the device is called
> > something else, and even if the device is simulated by some software
> > that takes input from the keyboard or the mouse.
> 
> But we cannot determine whether a given device is a foot pedal without
> the help of the user.

Who is "we" in this context?  What level of Emacs input processing
does this "we" allude to?

My point is that the level on which devices could be important is
below the code which inserts the events into the main Emacs event
queue from which we read events as part of our main loop.  If we agree
on that, we can stop arguing about making Emacs aware of the device
types, because the only aspect that worries me in your design is that
the device type should be exposed to, known by, and actively acted
upon on much higher levels, like the commands bound to respective
input events.  That is something we should IMO try hard to avoid.

> > Users cannot customize the low-level layers of event production in
> > Emacs, that level must be coded by us.  We shouldn't try aiming for
> > this goal, because it is basically unattainable, certainly as long as
> > we use the window-system messages as triggers for producing events
> > eventually exposed to Lisp.
> 
> Then we won't be able to know what a foot pedal is, because presumably
> foot pedals just name itself something we cannot guess, like "USB USB
> Keyboard (1)" or "FlexMatrix HID Keyboard Controller", since it's
> pretending to be a keyboard.

I don't yet understand why we _should_ know or care about that.  If a
device pretends to be a keyboard, but emits events that "normal"
keyboards cannot, we can still process such a device by pretending
those additional events are some special function keys.  Like we do
with several window-system messages already, and even with SIGUSR2
signal.  Is anything wrong with doing the same for those devices you
are talking about?  If so, what exactly is wrong and why?  Once again,
please reply by presenting specific use cases where this paradigm
cannot work well.



  reply	other threads:[~2022-04-10  6:44 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <164933858147.29834.15050766441005536059@vcs2.savannah.gnu.org>
     [not found] ` <20220407133623.9C209C009A8@vcs2.savannah.gnu.org>
2022-04-07 14:05   ` master 3b41141708: Expose the name of an event's input device to Lisp Stefan Monnier
2022-04-07 23:31     ` Po Lu
2022-04-07 23:41       ` Stefan Monnier
2022-04-08  0:07         ` Po Lu
2022-04-08  6:02         ` Eli Zaretskii
2022-04-08  6:08           ` Po Lu
2022-04-08  6:26             ` Eli Zaretskii
2022-04-08  7:36               ` Po Lu
2022-04-08 11:12                 ` Eli Zaretskii
2022-04-08 11:31                   ` Po Lu
2022-04-08 12:12                     ` Eli Zaretskii
2022-04-08 12:35                       ` Po Lu
2022-04-09  6:48                         ` Eli Zaretskii
2022-04-09  9:06                           ` Po Lu
2022-04-09  9:09                             ` Lars Ingebrigtsen
2022-04-09  9:30                             ` Eli Zaretskii
2022-04-09 10:03                               ` Po Lu
2022-04-09 11:03                                 ` Eli Zaretskii
2022-04-09 11:44                                   ` Po Lu
2022-04-09 14:04                                     ` Eli Zaretskii
2022-04-09 16:33                                       ` Stefan Monnier
2022-04-09 16:41                                         ` Lars Ingebrigtsen
2022-04-09 17:06                                           ` Eli Zaretskii
2022-04-09 17:16                                             ` Eli Zaretskii
2022-04-09 17:52                                             ` Brian Cully
2022-04-09 19:18                                               ` Eli Zaretskii
2022-04-10  0:54                                               ` Po Lu
2022-04-10  1:46                                                 ` Brian Cully
2022-04-10  2:11                                                   ` Po Lu
2022-04-10  2:45                                                     ` Brian Cully
2022-04-10  3:30                                                       ` Po Lu
2022-04-10  0:37                                           ` Po Lu
2022-04-10  5:49                                             ` Eli Zaretskii
2022-04-10  6:09                                               ` Po Lu
2022-04-10  6:44                                                 ` Eli Zaretskii [this message]
2022-04-10  7:31                                                   ` Po Lu
2022-04-10  8:28                                                     ` Eli Zaretskii
2022-04-10  8:50                                                       ` Po Lu
2022-04-10  9:17                                                         ` Eli Zaretskii
2022-04-10  9:25                                                           ` Po Lu
2022-04-10 11:15                                                             ` Po Lu
2022-04-10 15:16                                                               ` Stefan Monnier
2022-04-11  1:02                                                                 ` Po Lu
2022-04-10 11:46                                                   ` Lars Ingebrigtsen
2022-04-10 11:41                                             ` Lars Ingebrigtsen
2022-04-10  0:48                                       ` Po Lu
2022-04-10  6:04                                         ` Eli Zaretskii
2022-04-10  6:17                                           ` Po Lu
2022-04-10  6:49                                             ` Eli Zaretskii
2022-04-10  7:01                                               ` Po Lu
2022-04-10  8:24                                                 ` Eli Zaretskii
2022-04-10  8:42                                                   ` Po Lu
2022-04-10  9:13                                                     ` Eli Zaretskii
2022-04-10 12:51                                                       ` Brian Cully
2022-04-10 13:21                                                         ` Po Lu
2022-04-10 18:08                                                           ` Brian Cully
2022-04-11  0:58                                                             ` Po Lu
2022-04-11  1:08                                                               ` Brian Cully
2022-04-11  2:00                                                                 ` Po Lu
2022-04-11  2:03                                                                   ` Po Lu
2022-04-11  2:21                                                                   ` Brian Cully
2022-04-11  3:12                                                                     ` Po Lu
2022-04-11  4:11                                                                       ` Brian Cully
2022-04-11  5:20                                                                         ` Po Lu
2022-04-11 11:33                                                                           ` Brian Cully
2022-04-11 14:09                                                                             ` Po Lu
2022-04-11 16:26                                                                               ` Brian Cully
2022-04-11 10:10                                                             ` Lars Ingebrigtsen
2022-04-10 12:44                                                     ` Brian Cully
2022-04-10 13:14                                                       ` Po Lu
2022-04-08 14:27         ` Stefan Monnier
2022-04-09  0:24           ` Po Lu
2022-04-09  2:52             ` Stefan Monnier
2022-04-09  3:17               ` Po Lu
2022-04-09 13:31                 ` Stefan Monnier
2022-04-09 13:37                   ` Po Lu
2022-04-09 14:20                     ` Stefan Monnier
2022-04-10  0:58                       ` Po Lu
2022-04-09 14:31                     ` Eli Zaretskii
2022-04-10  0:56                       ` Po Lu
2022-04-10  6:11                         ` Eli Zaretskii
2022-04-10  6:23                           ` Po Lu
2022-04-10  6:52                             ` Eli Zaretskii
2022-04-10  7:37                               ` Po Lu
2022-04-10  8:12                                 ` Eli Zaretskii
2022-04-09  6:22             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y20d7808.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.