abo-abo / avy

Jump to things in Emacs tree-style
1.74k stars 111 forks source link

avy-action-* with avy-goto-line #191

Closed eflanigan00 closed 6 years ago

eflanigan00 commented 7 years ago

When avy-goto-line is called the actions seem to operate on words. It would be great if the actions worked on lines when avy-goto-line is called. The behavior I observe currently is avy-action-copy copies the word instead of the line when avy-goto-line is called.

abo-abo commented 7 years ago

Thanks. Feel free to PR for other actions.

eflanigan00 commented 7 years ago

Thank you! I have never done a PR before but I will take a look.

eflanigan00 commented 7 years ago

Can you give me some hits about what I might need to change to implement the others? My elisp isn't very strong and I'm having trouble with understanding how the functions fit together.

abo-abo commented 7 years ago

Look at this expression from avy-action-copy:

(if (eq avy-command 'avy-goto-line)
    (end-of-line)
  (forward-sexp))

Replace forward-sexp with that for actions you're interested in.

eflanigan00 commented 7 years ago

Thanks. I have used git to vc my own things but I've never contributed to a github project before. How should I propose the submitted changes?

abo-abo commented 7 years ago

You make a pull request on Github. See for example this tutorial: https://yangsu.github.io/pull-request-tutorial/

abo-abo commented 6 years ago

Thanks, please test.

eflanigan00 commented 6 years ago

This is great thank you!

For the avy-action-teleport on avy-goto-line can you either put the cursor at the beginning of the line or insert a new line and put the cursor on the new line. I'm not sure which is better behaviour, I think at the beginning of the line that was teleported but I'm not sure.