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

avy-goto-line breaks any subsequent avy--generic-jump call #124

Closed
Antoine-Patel opened this issue Dec 21, 2015 · 2 comments
Closed

avy-goto-line breaks any subsequent avy--generic-jump call #124

Antoine-Patel opened this issue Dec 21, 2015 · 2 comments

Comments

@Antoine-Patel
Copy link

Calling interactively avy-goto-line breaks any subsequent avy--generic-jump; the point does not move to the selected candidate of avy--generic-jump anymore. A call to avy-goto-char is then needed to unblock the situation.

Shortened steps to reproduce:

  • Eval (progn (call-interactively 'avy-goto-line) (avy--generic-jump "avy" nil 'at-full)), as long as there is at least one occurrence of "avy" (or change that part).

Full steps I use to reproduce the bug:

  • Launching emacs with -q flag (no init file).
  • Switching to *scratch* buffer.
  • Yanking and using eval, bits by bits:
(require 'avy)

(progn
  (call-interactively 'avy-goto-line)
  (avy--generic-jump "avy" nil 'at-full))
;; avy--generic-jump is "stuck": point does not move to the selected candidate.

;; Just for fun ----------------

(defun ap/avy-goto-line (&optional beg end)
  "Simpler subset implementation of `avy-goto-line'."

  (interactive)
  (avy--generic-jump "\\(^.\\|^\n\\)" nil 'at-full))

;; calling avy-goto-char to unblock avy--generic-jump.
(call-interactively 'avy-goto-char)

(progn
  (call-interactively 'ap/avy-goto-line)
  (avy--generic-jump "avy" nil 'at-full))

Note that the failing calls to avy--generic-jump all exit with the actual position of the candidate selected (eg. 811), but the point does not go to that position.

By the way, calling non interactively avy-goto-line with no argument makes it crash with (wrong-type-argument number-or-marker-p nil). Given the signature (avy-goto-line &optional ARG), I'd expect it to maybe do nothing (no jump), but to somewhat handle the case where no argument is given (?)


emacs version: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian
avy version: 20151219.630 (according to package-list-packages).

@abo-abo
Copy link
Owner

abo-abo commented Dec 22, 2015

Thanks.

@abo-abo
Copy link
Owner

abo-abo commented Dec 22, 2015

ap/avy-goto-line

I think I started with something as simple as this at some point. Then the support for goto-line was added, and for hidden lines (like in Org-mode).

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

2 participants