Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support always on "hats" style jumping #341

Open
Tracked by #541
ParetoOptimalDev opened this issue Feb 3, 2022 · 3 comments
Open
Tracked by #541

Support always on "hats" style jumping #341

ParetoOptimalDev opened this issue Feb 3, 2022 · 3 comments

Comments

@ParetoOptimalDev
Copy link

ParetoOptimalDev commented Feb 3, 2022

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.

@ParetoOptimalDev
Copy link
Author

ParetoOptimalDev commented Feb 7, 2022

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).

@ParetoOptimalDev
Copy link
Author

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.

@ParetoOptimalDev
Copy link
Author

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))))))
    ))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant