From: Drew Adams <drew.adams@oracle.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Eli Zaretskii <eliz@gnu.org>, fgunbin@fastmail.fm, emacs-devel@gnu.org
Subject: RE: Introducing thread-safe Tramp
Date: Sat, 4 Aug 2018 15:41:36 -0700 (PDT) [thread overview]
Message-ID: <297a37f1-5eb0-4fec-876b-e716c634de14@default> (raw)
In-Reply-To: <87a7q2vxsu.fsf@gmx.de>
> > You didn't answer wrt why we shouldn't just define additional commands
> > and let users create async/sync toggle commands using them (and
> > binding them to the same muscle-memory keys), or why we shouldn't also
> > create such toggle commands (toggling with a prefix arg), but not
> > necessarily bind them to the standard keys right away. IOW, what we
> > usually do.
>
> Because I believe this is more convenient.
I understand that you feel that. Why not find that out from users, over a period of time? If users end up binding the toggle commands I described, in place of the traditional file-operation bindings, then we'll know just how important and convenient such dispatching is. If only some users do that, and with only one or a couple of the file commands, then we'll have info to direct how best to accommodate that need.
Just a suggestion.
> It is common practice to change the behavior of a command by a prefix,
What does "a prefix" even mean, here? What's prefixing what?
It's common practice to sometimes change command behavior according to a _prefix argument_. There's no prefix argument involved here (except possibly before the second key sequence - the one that is read by `C-x &'). Certainly `C-x &' is not, itself, a prefix argument.
Nor is there any _prefix key_ involved here. `C-x &' is not bound to a keymap. I don't see how `C-x &' is a prefix <anything>.
And I don't see any common practice involved here. Rather, there is only one such use case I'm aware of: `C-x RET c'.
> and this is what "C-x &" is good for. It *is* a prefix;
Again, what does "a prefix" even mean? `C-x &' is a key sequence. What is it a prefix of? It's not a _prefix key_ (it's not bound to a keymap). What can a key sequence be a prefix of, if not of a set of key sequences, if it is not a prefix key?
`C-x &' is a key sequence that's bound to a command that reads a key sequence and invokes that second key sequence's command. And when reading the key sequence it allows use of prefix argument. But in what way is key sequence `C-x &' a "prefix" of something - what's that something that it prefixes?
If I type the key `a' and then I type the key `b', `a' is not a prefix of `b' in any usual sense. The behavior you have does not fit any of the current uses of the word "prefix" in Emacs jargon/doc, I think.
If you try to think of `C-x &' as some (new) kind of "prefix" then please start by saying what it is a prefix of.
> just the implementation varies.
Implementation of what? The answer, from your statement, can only be "a prefix". But implementation of a prefix of what? What is this "a prefix" you speak of?
> > Right. But this is still a new use case, I think. The `C-x RET c' case
> > is pretty much the only other use of this technique, AFAIK.
> >
> > We document the use of prefix keys, i.e., binding a key to a
> > keymap. We don't document this technique/cliche. Perhaps we should.
>
> Agreed. Now, we have two special cases. I agree also with you to make
> this technique more general, but since I'm in the muddy waters of
> threads, I'd like to postpone it a bit (or somebody else does). If we
> have the more general approach, it deserves documentation.
Sounds good. Thanks for working on the threading feature. Sounds very good.
I don't think this technique / programming cliche (used for `C-x RET c' and proposed for `C-x &') should be passed off as somehow using a different kind of prefix argument - no connection, IMO. Nor should the key sequence involved be shoehorned into consideration as a prefix key. It's neither.
I don't see any useful use of the word "prefix" here, but if there is one then it needs to be defined explicitly, as some new kind of prefixing (starting by saying what gets prefixed).
I think we agree that this technique/cliche is interesting and could be applied more widely by users (other use cases) or turned into something more general (making it easy for users to take advantage of, for their own key-reading commands, without going through the same implementation cliche explicitly).
One could even imagine (similarly to a prefix key whose keymap binding has one or more prefix keys) applying the technique more than once in succession: a command that reads a key sequence (possibly with prefix arg) being itself read by a command that reads a key sequence (possibly with prefix arg).
Whereas it is simple to move a keymap around, binding it to this or that prefix key (any of which might itself be in a keymap that is bound to a prefix key...), it's a bit more cumbersome (less modular) to combine things and move them around with the technique in question.
It's about defining a particular kind of command. Perhaps some good new programming constructs can be found, to help out here. Maybe a command-defining macro, to bundle up the technique nicely. Or maybe we're hinting at a variant of or a new form for a keymap.
(Another thing that comes to (my) mind here, for some reason, are hydras...)
next prev parent reply other threads:[~2018-08-04 22:41 UTC|newest]
Thread overview: 125+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-23 15:58 Introducing thread-safe Tramp Michael Albinus
2018-07-23 16:06 ` Eli Zaretskii
2018-07-23 16:11 ` Michael Albinus
2018-07-23 16:37 ` Eli Zaretskii
2018-07-23 16:55 ` Michael Albinus
2018-07-24 8:25 ` Ken Raeburn
2018-07-24 12:52 ` Michael Albinus
2018-07-24 13:20 ` martin rudalics
2018-07-25 9:51 ` Michael Albinus
2018-07-25 14:44 ` Eli Zaretskii
2018-07-25 17:32 ` Eli Zaretskii
2018-07-25 17:53 ` Michael Albinus
2018-07-26 7:56 ` martin rudalics
2018-07-26 8:14 ` Michael Albinus
2018-07-26 9:02 ` martin rudalics
2018-07-26 17:24 ` Eli Zaretskii
2018-07-24 15:06 ` Drew Adams
2018-07-25 9:46 ` Michael Albinus
2018-07-25 11:54 ` Phil Sainty
2018-07-25 12:14 ` Andreas Schwab
2018-07-25 13:02 ` Michael Albinus
2018-07-25 13:31 ` Robert Pluim
2018-07-27 15:05 ` Michael Albinus
2018-08-01 16:27 ` Robert Pluim
2018-08-01 21:28 ` Michael Albinus
2018-07-27 19:04 ` Filipp Gunbin
2018-07-27 19:42 ` Michael Albinus
2018-07-28 0:14 ` Filipp Gunbin
2018-07-28 7:01 ` Eli Zaretskii
2018-07-28 9:48 ` Michael Albinus
2018-07-29 18:29 ` Drew Adams
2018-07-30 8:44 ` Michael Albinus
2018-07-30 14:23 ` Eli Zaretskii
2018-08-04 12:47 ` Michael Albinus
2018-08-04 12:49 ` Michael Albinus
2018-08-04 15:00 ` Eli Zaretskii
2018-08-04 15:12 ` Michael Albinus
2018-08-04 15:43 ` Eli Zaretskii
2018-08-04 15:58 ` Michael Albinus
2018-08-04 16:11 ` Eli Zaretskii
2018-08-04 16:18 ` Michael Albinus
2018-08-04 16:58 ` Eli Zaretskii
2018-08-04 17:29 ` Michael Albinus
2018-08-04 18:34 ` Eli Zaretskii
2018-08-05 9:51 ` Michael Albinus
2018-08-05 15:06 ` Eli Zaretskii
2018-08-06 10:54 ` Michael Albinus
2018-08-06 14:55 ` Drew Adams
2018-08-06 15:25 ` C-x & (was: Introducing thread-safe Tramp) Michael Albinus
2018-08-06 17:59 ` Drew Adams
2018-08-06 19:17 ` C-x & Michael Albinus
2018-08-06 20:57 ` Drew Adams
2018-08-06 23:16 ` Drew Adams
2018-08-07 7:05 ` Michael Albinus
2018-08-07 7:01 ` Michael Albinus
2018-08-06 15:48 ` Introducing thread-safe Tramp Stefan Monnier
2018-08-06 15:24 ` Eli Zaretskii
2018-08-06 15:29 ` C-x & (was: Introducing thread-safe Tramp) Michael Albinus
2018-08-06 18:32 ` Introducing thread-safe Tramp Filipp Gunbin
2018-08-07 14:20 ` Michael Albinus
2018-08-07 14:53 ` Stephen Berman
2018-08-07 15:02 ` Robert Pluim
2018-08-07 15:06 ` Stephen Berman
2018-08-07 16:00 ` Michael Albinus
2018-08-07 15:58 ` Michael Albinus
2018-08-07 15:33 ` Drew Adams
2018-08-07 16:01 ` Michael Albinus
2018-08-07 16:12 ` Drew Adams
2018-08-07 16:18 ` Michael Albinus
2018-08-07 15:56 ` Michael Albinus
2018-08-07 16:24 ` Eli Zaretskii
2018-08-07 16:30 ` Michael Albinus
2018-08-07 15:56 ` Eli Zaretskii
2018-08-07 16:09 ` Michael Albinus
2018-08-07 16:23 ` Drew Adams
2018-08-07 16:46 ` Drew Adams
2018-08-07 16:54 ` Michael Albinus
2018-08-07 17:11 ` Eli Zaretskii
2018-08-08 8:18 ` Michael Albinus
2018-08-08 19:01 ` Filipp Gunbin
2018-08-08 20:52 ` Stefan Monnier
2018-08-08 20:54 ` Drew Adams
2018-08-04 15:42 ` Drew Adams
2018-08-04 15:56 ` Michael Albinus
2018-08-04 16:16 ` Drew Adams
2018-08-04 17:36 ` Michael Albinus
2018-08-04 22:41 ` Drew Adams [this message]
2018-08-05 10:03 ` Michael Albinus
2018-08-04 16:08 ` Eli Zaretskii
[not found] ` <<7c28f9d8-e2bb-4778-ab92-92707f12718f@default>
[not found] ` <<837el6t8r3.fsf@gnu.org>
2018-08-04 16:27 ` Drew Adams
2018-08-04 16:59 ` Eli Zaretskii
2018-08-05 1:59 ` Richard Stallman
2018-08-05 10:07 ` Michael Albinus
2018-08-06 1:20 ` Richard Stallman
2018-08-05 15:36 ` Drew Adams
2018-08-06 4:21 ` Howard Melman
2018-08-06 4:39 ` Werner LEMBERG
2018-08-06 8:07 ` Michael Albinus
2018-08-06 13:50 ` Clément Pit-Claudel
2018-08-06 14:57 ` Drew Adams
2018-08-06 14:52 ` Drew Adams
2018-08-06 15:52 ` Howard Melman
2018-08-06 15:46 ` Stefan Monnier
2018-07-27 21:08 ` Eli Zaretskii
2018-07-28 0:24 ` Filipp Gunbin
2018-07-28 9:02 ` Michael Albinus
2018-07-27 19:19 ` Dmitry Gutov
2018-07-27 19:32 ` Michael Albinus
2018-07-27 19:40 ` Yuri Khan
2018-07-27 19:43 ` Michael Albinus
2018-07-27 20:09 ` Yuri Khan
2018-07-27 21:15 ` Eli Zaretskii
2018-07-28 9:11 ` Michael Albinus
2018-07-28 9:57 ` Eli Zaretskii
2018-07-28 10:04 ` Michael Albinus
2018-07-27 22:57 ` Dmitry Gutov
2018-07-27 22:59 ` Dmitry Gutov
2018-07-28 9:18 ` Michael Albinus
2018-07-28 9:36 ` Dmitry Gutov
2018-07-28 9:51 ` Michael Albinus
2018-07-28 9:59 ` Dmitry Gutov
2018-07-28 10:13 ` Michael Albinus
2018-07-28 22:20 ` Dmitry Gutov
2018-07-29 9:54 ` Michael Albinus
2018-08-08 16:49 ` Dmitry Gutov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=297a37f1-5eb0-4fec-876b-e716c634de14@default \
--to=drew.adams@oracle.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=fgunbin@fastmail.fm \
--cc=michael.albinus@gmx.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).