abo-abo/avy

Support always on "hats" style jumping

Opened this issue · 3 comments

What

Cursorless with hats style jumping

The above example uses voice, but imagine using avy-go-to-char the first letter to type would be the "hat" color (unless white) and the second the letter the "hat" is over.

TODO: write text example when I get back to desktop

Why

A faster jumping style for voice input and normal typical text input users.

Cursorless and "hats" are the state of the art way of navigating/modifying via voice.

Video tutorial with examples

The big difference from avy currently is that the overlays referred to as hats are always visible. Then you can jump to letters with the color white by saying just the letter. There is a related but maybe incompatible issue about color #298

I think this method might be faster for both voice and typical text inputs because the user has the combination to type cached when calling avy-go-to-char.

How

This is the part I need help with. I don't think it would be too hard to do, but I do have some concerns with the performance of overlays that are always on in the constant cost of them.

I also don't know if there is interest in this project to implement such a thing or if it seems useful to others currently happily using avy its current styles.

Similar to #215, but display would always be on in buffer and one potential implementation is a new "top-color" style added along with #298 so the color and the char under it are typed.

This color/char style would likely be less efficient for keyboard input users but way more efficient for any voice users (I know one besides myself, lol).

I'm pretty sure that I can copy avy-linum-mode for this, though i'd need avy-goto-word-0 to account for it like avy-goto-line does.

If there were a function to display overlays on all items in a tree I think my current elisp capabilities could manage this. Given how things currently work in avy--process-1 -> avy-read I can see why there isn't one since the assumption is that when there are overlays the user will soon give a character or C-g.

It looks like this kind of does it but I introduced a bug. I'll have to pick this up again at a later time, stuck in vscode until then 🗡️

😆

(defun avy-noread-only-display (tree display-fn)
  (while tree
    (let ((avy--leafs nil))
      (avy-traverse tree
                    (lambda (path leaf)
                      (push (cons path leaf) avy--leafs)))
      (dolist (x avy--leafs)
        (funcall display-fn (car x) (cdr x))))
    (let ((branch)
          (if (setq branch (assoc char tree))
              (if (eq (car (setq tree (cdr branch))) 'leaf)
                  (throw 'done (cdr tree))))))
    ))