abo-abo / avy

Jump to things in Emacs tree-style
1.71k stars 109 forks source link

Feasibility of modeless usage? #311

Open bard opened 4 years ago

bard commented 4 years ago

I think of avy's default interaction as "modal" in the vi sense:

  1. press a key combination (associated to e.g. avy-goto-word-1)
  2. release key combination
  3. a different input mode is entered
  4. press a modifier-less key (e.g. e)
  5. some processing is done (words beginning with e are highlighted)
  6. press another modifier-less key (e.g. a)
  7. some more processing is done (e.g. cursor moves to "e.g.")
  8. editor returns to the previous input mode

I looked at the unused AltGr key on my keyboard and wondered, would an Emacs-style modeless interaction be possible?

  1. press a modifier key
  2. don't release it
  3. press e
  4. words beginning with e are highlighted
  5. press a
  6. cursor moves to "e.g."
  7. release modifier

My hunch is no, because Emacs will wait for a key sequence to be complete before doing any processing; unless we "fake" it by creating key bindings for all possible combinations in advance. But maybe I'm wrong?