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

Error occured when using C-g to abort swiper-avy #2062

Closed
cireu opened this issue May 14, 2019 · 2 comments
Closed

Error occured when using C-g to abort swiper-avy #2062

cireu opened this issue May 14, 2019 · 2 comments
Labels

Comments

@cireu
Copy link
Contributor

@cireu cireu commented May 14, 2019

Info

Recipe

  1. make plain, turn debug on.
  2. M-x swiper, type some chars and use C-' to trigger swiper-avy
  3. Don't select a candidate but use C-g to abort it.
  4. Got debug message
Debugger entered--Lisp error: (wrong-type-argument listp exit)
cdr(exit)
(window-minibuffer-p (cdr candidate))
(if (window-minibuffer-p (cdr candidate)) (let ((cand-text (save-excursion (goto-char (car candidate)) (buffer-substring-no-properties (line-beginning-position) (line-end-position))))) (ivy-set-index (cl-position-if #'(lambda (x) (cl-search x cand-text)) ivy--old-cands)) (ivy--exhibit) (ivy-done) (ivy-call)) (progn (put 'quit 'error-message "") (run-at-time nil nil #'(lambda nil (put 'quit 'error-message "Quit") (condition-case err (avy-action-goto (avy-candidate-beg candidate)) ((debug error) (message "Error: %S" err) nil)))) (abort-recursive-edit)))
swiper--avy-goto(exit)
swiper-avy()
funcall-interactively(swiper-avy)
call-interactively(swiper-avy nil nil)
command-execute(swiper-avy)
read-from-minibuffer("Swiper: " nil (keymap (keymap (3 keymap (6 . swiper-toggle-face-matching)) (67108919 . swiper-mc) (67108903 . swiper-avy) (12 . swiper-recenter-top-bottom) (27 keymap (113 . swiper-query-replace))) keymap (36 . ivy-magic-read-file-env) (3 keymap (19 . ivy-rotate-sort) (1 . ivy-toggle-ignore) (15 . ivy-occur)) (67108903 . ivy-avy) (33554464 . ivy-restrict-to-matches) (15 . hydra-ivy/body) (22 . ivy-scroll-up-command) (prior . ivy-scroll-down-command) (next . ivy-scroll-up-command) (7 . minibuffer-keyboard-quit) (right . ivy-forward-char) (32 . self-insert-command) (18 . ivy-reverse-i-search) (19 . ivy-next-line-or-history) (remap keymap (describe-mode . ivy-help) (kill-ring-save . ivy-kill-ring-save) (kill-whole-line . ivy-kill-whole-line) (kill-line . ivy-kill-line) (scroll-down-command . ivy-scroll-down-command) (scroll-up-command . ivy-scroll-up-command) (end-of-buffer . ivy-end-of-buffer) (beginning-of-buffer . ivy-beginning-of-buffer) (kill-word . ivy-kill-word) (forward-char . ivy-forward-char) (delete-char . ivy-delete-char) (backward-kill-word . ivy-backward-kill-word) (backward-delete-char-untabify . ivy-backward-delete-char) (delete-backward-char . ivy-backward-delete-char) (previous-line . ivy-previous-line) (next-line . ivy-next-line)) (9 . ivy-partial-or-done) (10 . ivy-alt-done) (27 keymap (1 . ivy-read-action) (15 . ivy-dispatching-call) (111 . ivy-dispatching-done) (105 . ivy-insert-current) (106 . ivy-yank-word) (114 . ivy-toggle-regexp-quote) (16 . ivy-previous-line-and-call) (14 . ivy-next-line-and-call) (118 . ivy-scroll-down-command) (112 . ivy-previous-history-element) (110 . ivy-next-history-element) (10 . ivy-immediate-done) (13 . ivy-call)) (mouse-3 . ivy-mouse-dispatching-done) (mouse-1 . ivy-mouse-done) (down-mouse-1 . ignore) (13 . ivy-done)) nil swiper-history)
(if (and ivy-auto-select-single-candidate ivy--all-candidates (null (cdr ivy--all-candidates))) (progn (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (let* ((v ivy-last)) (aset v 23 (car ivy--all-candidates)))) (setq ivy-exit 'done)) (read-from-minibuffer prompt (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (aref ivy-last 5)) (make-composed-keymap keymap ivy-minibuffer-map) nil hist))
(let* ((hist (or history 'ivy-history)) (minibuffer-completion-table collection) (minibuffer-completion-predicate predicate) (ivy-height height) (resize-mini-windows (if (display-graphic-p) nil 'grow-only))) (if (and ivy-auto-select-single-candidate ivy--all-candidates (null (cdr ivy--all-candidates))) (progn (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (let* ((v ivy-last)) (aset v 23 (car ivy--all-candidates)))) (setq ivy-exit 'done)) (read-from-minibuffer prompt (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (aref ivy-last 5)) (make-composed-keymap keymap ivy-minibuffer-map) nil hist)) (if (eq ivy-exit 'done) (progn (let ((item (if ivy--directory (progn ... ...) ivy-text))) (if (equal item "") nil (set hist (cons (propertize item ... ivy--index) (delete item ...))))))) (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (aref ivy-last 23)))
(progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((hist (or history 'ivy-history)) (minibuffer-completion-table collection) (minibuffer-completion-predicate predicate) (ivy-height height) (resize-mini-windows (if (display-graphic-p) nil 'grow-only))) (if (and ivy-auto-select-single-candidate ivy--all-candidates (null (cdr ivy--all-candidates))) (progn (progn (or (and (memq ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... ivy-last))) (let* ((v ivy-last)) (aset v 23 (car ivy--all-candidates)))) (setq ivy-exit 'done)) (read-from-minibuffer prompt (progn (or (and (memq ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... ivy-last))) (aref ivy-last 5)) (make-composed-keymap keymap ivy-minibuffer-map) nil hist)) (if (eq ivy-exit 'done) (progn (let ((item (if ivy--directory ... ivy-text))) (if (equal item "") nil (set hist (cons ... ...)))))) (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (aref ivy-last 23))))
(unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((hist (or history 'ivy-history)) (minibuffer-completion-table collection) (minibuffer-completion-predicate predicate) (ivy-height height) (resize-mini-windows (if (display-graphic-p) nil 'grow-only))) (if (and ivy-auto-select-single-candidate ivy--all-candidates (null (cdr ivy--all-candidates))) (progn (progn (or (and ... t) (signal ... ...)) (let* (...) (aset v 23 ...))) (setq ivy-exit 'done)) (read-from-minibuffer prompt (progn (or (and ... t) (signal ... ...)) (aref ivy-last 5)) (make-composed-keymap keymap ivy-minibuffer-map) nil hist)) (if (eq ivy-exit 'done) (progn (let ((item ...)) (if (equal item "") nil (set hist ...))))) (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (aref ivy-last 23)))) (remove-hook 'minibuffer-setup-hook setup-hook))
(let ((fun #'ivy--minibuffer-setup) setup-hook) (setq setup-hook #'(lambda nil (remove-hook 'minibuffer-setup-hook setup-hook) (funcall fun))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((hist (or history 'ivy-history)) (minibuffer-completion-table collection) (minibuffer-completion-predicate predicate) (ivy-height height) (resize-mini-windows (if (display-graphic-p) nil 'grow-only))) (if (and ivy-auto-select-single-candidate ivy--all-candidates (null (cdr ivy--all-candidates))) (progn (progn (or ... ...) (let* ... ...)) (setq ivy-exit 'done)) (read-from-minibuffer prompt (progn (or ... ...) (aref ivy-last 5)) (make-composed-keymap keymap ivy-minibuffer-map) nil hist)) (if (eq ivy-exit 'done) (progn (let (...) (if ... nil ...)))) (progn (or (and (memq ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... ivy-last))) (aref ivy-last 23)))) (remove-hook 'minibuffer-setup-hook setup-hook)))
(unwind-protect (let ((fun #'ivy--minibuffer-setup) setup-hook) (setq setup-hook #'(lambda nil (remove-hook 'minibuffer-setup-hook setup-hook) (funcall fun))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((hist (or history ...)) (minibuffer-completion-table collection) (minibuffer-completion-predicate predicate) (ivy-height height) (resize-mini-windows (if ... nil ...))) (if (and ivy-auto-select-single-candidate ivy--all-candidates (null ...)) (progn (progn ... ...) (setq ivy-exit ...)) (read-from-minibuffer prompt (progn ... ...) (make-composed-keymap keymap ivy-minibuffer-map) nil hist)) (if (eq ivy-exit 'done) (progn (let ... ...))) (progn (or (and ... t) (signal ... ...)) (aref ivy-last 23)))) (remove-hook 'minibuffer-setup-hook setup-hook))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook #'ivy--queue-exhibit) (let ((cleanup (ivy--display-function-prop :cleanup))) (if (functionp cleanup) (progn (funcall cleanup)))) (if (setq unwind (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (aref ivy-last 16))) (progn (funcall unwind))) (ivy--pulse-cleanup) (if (eq ivy-exit 'done) nil (ivy-recursive-restore)))
(prog1 (unwind-protect (let ((fun #'ivy--minibuffer-setup) setup-hook) (setq setup-hook #'(lambda nil (remove-hook 'minibuffer-setup-hook setup-hook) (funcall fun))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((hist ...) (minibuffer-completion-table collection) (minibuffer-completion-predicate predicate) (ivy-height height) (resize-mini-windows ...)) (if (and ivy-auto-select-single-candidate ivy--all-candidates ...) (progn ... ...) (read-from-minibuffer prompt ... ... nil hist)) (if (eq ivy-exit ...) (progn ...)) (progn (or ... ...) (aref ivy-last 23)))) (remove-hook 'minibuffer-setup-hook setup-hook))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook #'ivy--queue-exhibit) (let ((cleanup (ivy--display-function-prop :cleanup))) (if (functionp cleanup) (progn (funcall cleanup)))) (if (setq unwind (progn (or (and (memq ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... ivy-last))) (aref ivy-last 16))) (progn (funcall unwind))) (ivy--pulse-cleanup) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (ivy--remove-props (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (aref ivy-last 23)) 'idx))
(let* ((ivy-recursive-last (and (active-minibuffer-window) ivy-last)) (transformer-fn (plist-get ivy--display-transformers-list (cond (caller) ((functionp collection) collection)))) (ivy-display-function (if (or ivy-recursive-last (not (window-minibuffer-p))) (progn (or ivy-display-function (ivy-alist-setting ivy-display-functions-alist caller))))) (height (ivy--height caller))) (setq ivy-last (record 'ivy-state prompt collection predicate require-match initial-input history preselect keymap (if (eq update-fn 'auto) #'(lambda nil (funcall (ivy--get-action ivy-last) (progn ... ...))) update-fn) sort (selected-frame) (selected-window) (current-buffer) nil action unwind re-builder matcher dynamic-collection transformer-fn default-directory caller nil def)) (ivy--reset-state ivy-last) (prog1 (unwind-protect (let ((fun #'ivy--minibuffer-setup) setup-hook) (setq setup-hook #'(lambda nil (remove-hook ... setup-hook) (funcall fun))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* (... ... ... ... ...) (if ... ... ...) (if ... ...) (progn ... ...))) (remove-hook 'minibuffer-setup-hook setup-hook))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook #'ivy--queue-exhibit) (let ((cleanup (ivy--display-function-prop :cleanup))) (if (functionp cleanup) (progn (funcall cleanup)))) (if (setq unwind (progn (or (and ... t) (signal ... ...)) (aref ivy-last 16))) (progn (funcall unwind))) (ivy--pulse-cleanup) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (ivy--remove-props (progn (or (and (memq (type-of ivy-last) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state ivy-last))) (aref ivy-last 23)) 'idx)))
(progn (let ((extra-actions (cl-delete-duplicates (append (plist-get ivy--actions-list t) (plist-get ivy--actions-list this-command) (plist-get ivy--actions-list caller)) :key #'car :test #'equal))) (if extra-actions (progn (setq action (cond ((functionp action) (cons 1 ...)) ((null action) (cons 1 ...)) (t (delete-dups ...))))))) (setq ivy-marked-candidates nil) (if caller nil (setq caller this-command)) (let ((extra-sources (plist-get ivy--sources-list caller))) (if extra-sources (progn (setq ivy--extra-candidates nil) (let ((--dolist-tail-- extra-sources)) (while --dolist-tail-- (let (...) (cond ... ...) (setq --dolist-tail-- ...))))) (setq ivy--extra-candidates '((original-source))))) (let* ((ivy-recursive-last (and (active-minibuffer-window) ivy-last)) (transformer-fn (plist-get ivy--display-transformers-list (cond (caller) ((functionp collection) collection)))) (ivy-display-function (if (or ivy-recursive-last (not (window-minibuffer-p))) (progn (or ivy-display-function (ivy-alist-setting ivy-display-functions-alist caller))))) (height (ivy--height caller))) (setq ivy-last (record 'ivy-state prompt collection predicate require-match initial-input history preselect keymap (if (eq update-fn 'auto) #'(lambda nil (funcall ... ...)) update-fn) sort (selected-frame) (selected-window) (current-buffer) nil action unwind re-builder matcher dynamic-collection transformer-fn default-directory caller nil def)) (ivy--reset-state ivy-last) (prog1 (unwind-protect (let ((fun #'ivy--minibuffer-setup) setup-hook) (setq setup-hook #'(lambda nil ... ...)) (unwind-protect (progn (add-hook ... setup-hook) (let* ... ... ... ...)) (remove-hook 'minibuffer-setup-hook setup-hook))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook #'ivy--queue-exhibit) (let ((cleanup (ivy--display-function-prop :cleanup))) (if (functionp cleanup) (progn (funcall cleanup)))) (if (setq unwind (progn (or ... ...) (aref ivy-last 16))) (progn (funcall unwind))) (ivy--pulse-cleanup) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (ivy--remove-props (progn (or (and (memq ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... ivy-last))) (aref ivy-last 23)) 'idx))))
(progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:predicate :require-match :initial-input :history :preselect :def :keymap :update-fn :sort :action :unwind :re-builder :matcher :dynamic-collection :caller :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ... --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:predicate :requir..." (car --cl-keys--)))))) (progn (let ((extra-actions (cl-delete-duplicates (append (plist-get ivy--actions-list t) (plist-get ivy--actions-list this-command) (plist-get ivy--actions-list caller)) :key #'car :test #'equal))) (if extra-actions (progn (setq action (cond (... ...) (... ...) (t ...)))))) (setq ivy-marked-candidates nil) (if caller nil (setq caller this-command)) (let ((extra-sources (plist-get ivy--sources-list caller))) (if extra-sources (progn (setq ivy--extra-candidates nil) (let ((--dolist-tail-- extra-sources)) (while --dolist-tail-- (let ... ... ...)))) (setq ivy--extra-candidates '((original-source))))) (let* ((ivy-recursive-last (and (active-minibuffer-window) ivy-last)) (transformer-fn (plist-get ivy--display-transformers-list (cond (caller) (... collection)))) (ivy-display-function (if (or ivy-recursive-last (not ...)) (progn (or ivy-display-function ...)))) (height (ivy--height caller))) (setq ivy-last (record 'ivy-state prompt collection predicate require-match initial-input history preselect keymap (if (eq update-fn 'auto) #'(lambda nil ...) update-fn) sort (selected-frame) (selected-window) (current-buffer) nil action unwind re-builder matcher dynamic-collection transformer-fn default-directory caller nil def)) (ivy--reset-state ivy-last) (prog1 (unwind-protect (let ((fun ...) setup-hook) (setq setup-hook #'...) (unwind-protect (progn ... ...) (remove-hook ... setup-hook))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook #'ivy--queue-exhibit) (let ((cleanup ...)) (if (functionp cleanup) (progn ...))) (if (setq unwind (progn ... ...)) (progn (funcall unwind))) (ivy--pulse-cleanup) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (ivy--remove-props (progn (or (and ... t) (signal ... ...)) (aref ivy-last 23)) 'idx)))))
(let* ((predicate (car (cdr (plist-member --cl-rest-- ':predicate)))) (require-match (car (cdr (plist-member --cl-rest-- ':require-match)))) (initial-input (car (cdr (plist-member --cl-rest-- ':initial-input)))) (history (car (cdr (plist-member --cl-rest-- ':history)))) (preselect (car (cdr (plist-member --cl-rest-- ':preselect)))) (def (car (cdr (plist-member --cl-rest-- ':def)))) (keymap (car (cdr (plist-member --cl-rest-- ':keymap)))) (update-fn (car (cdr (plist-member --cl-rest-- ':update-fn)))) (sort (car (cdr (plist-member --cl-rest-- ':sort)))) (action (car (cdr (plist-member --cl-rest-- ':action)))) (unwind (car (cdr (plist-member --cl-rest-- ':unwind)))) (re-builder (car (cdr (plist-member --cl-rest-- ':re-builder)))) (matcher (car (cdr (plist-member --cl-rest-- ':matcher)))) (dynamic-collection (car (cdr (plist-member --cl-rest-- ':dynamic-collection)))) (caller (car (cdr (plist-member --cl-rest-- ':caller))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '...) (setq --cl-keys-- (cdr ...))) ((car (cdr ...)) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:predicate :requir..." (car --cl-keys--)))))) (progn (let ((extra-actions (cl-delete-duplicates (append ... ... ...) :key #'car :test #'equal))) (if extra-actions (progn (setq action (cond ... ... ...))))) (setq ivy-marked-candidates nil) (if caller nil (setq caller this-command)) (let ((extra-sources (plist-get ivy--sources-list caller))) (if extra-sources (progn (setq ivy--extra-candidates nil) (let (...) (while --dolist-tail-- ...))) (setq ivy--extra-candidates '(...)))) (let* ((ivy-recursive-last (and (active-minibuffer-window) ivy-last)) (transformer-fn (plist-get ivy--display-transformers-list (cond ... ...))) (ivy-display-function (if (or ivy-recursive-last ...) (progn ...))) (height (ivy--height caller))) (setq ivy-last (record 'ivy-state prompt collection predicate require-match initial-input history preselect keymap (if (eq update-fn ...) #'... update-fn) sort (selected-frame) (selected-window) (current-buffer) nil action unwind re-builder matcher dynamic-collection transformer-fn default-directory caller nil def)) (ivy--reset-state ivy-last) (prog1 (unwind-protect (let (... setup-hook) (setq setup-hook ...) (unwind-protect ... ...)) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook #'ivy--queue-exhibit) (let (...) (if ... ...)) (if (setq unwind ...) (progn ...)) (ivy--pulse-cleanup) (if (eq ivy-exit ...) nil (ivy-recursive-restore))) (ivy-call) (ivy--remove-props (progn (or ... ...) (aref ivy-last 23)) 'idx))))))
ivy-read("Swiper: " (#(" ;;; avy.el --- Jump to ar..." 0 1 (swiper-line-number "1    " display "1    ") 1 5 (fontified t face font-lock-comment-delimiter-face) 5 111 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "2    " display "2    ")) #(" ;; Copyright (C) 2015  Fr..." 0 1 (swiper-line-number "3    " display "3    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 54 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "4    " display "4    ")) #(" ;; Author: Oleh Krehel <o..." 0 1 (swiper-line-number "5    " display "5    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 45 (fontified t face font-lock-comment-face)) #(" ;; URL: https://github.co..." 0 1 (swiper-line-number "6    " display "6    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 39 (fontified t face font-lock-comment-face)) #(" ;; Version: 0.4.0" 0 1 (swiper-line-number "7    " display "7    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 18 (fontified t face font-lock-comment-face)) #(" ;; Package-Requires: ((em..." 0 1 (swiper-line-number "8    " display "8    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 53 (fontified t face font-lock-comment-face)) #(" ;; Keywords: point, locat..." 0 1 (swiper-line-number "9    " display "9    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 29 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "10   " display "10   ")) #(" ;; This file is part of G..." 0 1 (swiper-line-number "11   " display "11   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 35 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "12   " display "12   ")) #(" ;; This file is free soft..." 0 1 (swiper-line-number "13   " display "13   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 69 (fontified t face font-lock-comment-face)) #(" ;; it under the terms of ..." 0 1 (swiper-line-number "14   " display "14   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 72 (fontified t face font-lock-comment-face)) #(" ;; the Free Software Foun..." 0 1 (swiper-line-number "15   " display "15   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 71 (fontified t face font-lock-comment-face)) #(" ;; any later version." 0 1 (swiper-line-number "16   " display "16   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 22 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "17   " display "17   ")) #(" ;; This program is distri..." 0 1 (swiper-line-number "18   " display "18   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 67 (fontified t face font-lock-comment-face)) #(" ;; but WITHOUT ANY WARRAN..." 0 1 (swiper-line-number "19   " display "19   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 66 (fontified t face font-lock-comment-face)) #(" ;; MERCHANTABILITY or FIT..." 0 1 (swiper-line-number "20   " display "20   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 65 (fontified t face font-lock-comment-face)) #(" ;; GNU General Public Lic..." 0 1 (swiper-line-number "21   " display "21   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 48 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "22   " display "22   ")) #(" ;; For a full copy of the..." 0 1 (swiper-line-number "23   " display "23   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 53 (fontified t face font-lock-comment-face)) #(" ;; see <http://www.gnu.or..." 0 1 (swiper-line-number "24   " display "24   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 39 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "25   " display "25   ")) #(" ;;; Commentary:" 0 1 (swiper-line-number "26   " display "26   ") 1 5 (fontified t face font-lock-comment-delimiter-face) 5 16 (fontified t face font-lock-comment-face)) ...) :initial-input nil :keymap (keymap (3 keymap (6 . swiper-toggle-face-matching)) (67108919 . swiper-mc) (67108903 . swiper-avy) (12 . swiper-recenter-top-bottom) (27 keymap (113 . swiper-query-replace))) :preselect 0 :require-match t :update-fn swiper--update-input-ivy :unwind swiper--cleanup :action swiper--action :re-builder swiper--re-builder :history swiper-history :caller swiper)
(setq res (ivy-read "Swiper: " candidates :initial-input initial-input :keymap swiper-map :preselect preselect :require-match t :update-fn #'swiper--update-input-ivy :unwind #'swiper--cleanup :action #'swiper--action :re-builder #'swiper--re-builder :history 'swiper-history :caller 'swiper))
(and (setq res (ivy-read "Swiper: " candidates :initial-input initial-input :keymap swiper-map :preselect preselect :require-match t :update-fn #'swiper--update-input-ivy :unwind #'swiper--cleanup :action #'swiper--action :re-builder #'swiper--re-builder :history 'swiper-history :caller 'swiper)) (point))
(unwind-protect (and (setq res (ivy-read "Swiper: " candidates :initial-input initial-input :keymap swiper-map :preselect preselect :require-match t :update-fn #'swiper--update-input-ivy :unwind #'swiper--cleanup :action #'swiper--action :re-builder #'swiper--re-builder :history 'swiper-history :caller 'swiper)) (point)) (if (or res swiper-stay-on-quit) nil (goto-char swiper--opoint)) (if (or res (string= ivy-text "")) nil (let* ((var ivy-text)) (if (memql var swiper-history) (with-no-warnings swiper-history) (setq swiper-history (cons var swiper-history))))) (if swiper--reveal-mode (progn (reveal-mode 1))))
(let ((preselect (if swiper-use-visual-line (count-screen-lines (point-min) (save-excursion (beginning-of-visual-line) (point))) (1- (line-number-at-pos)))) (minibuffer-allow-text-properties t) res) (unwind-protect (and (setq res (ivy-read "Swiper: " candidates :initial-input initial-input :keymap swiper-map :preselect preselect :require-match t :update-fn #'swiper--update-input-ivy :unwind #'swiper--cleanup :action #'swiper--action :re-builder #'swiper--re-builder :history 'swiper-history :caller 'swiper)) (point)) (if (or res swiper-stay-on-quit) nil (goto-char swiper--opoint)) (if (or res (string= ivy-text "")) nil (let* ((var ivy-text)) (if (memql var swiper-history) (with-no-warnings swiper-history) (setq swiper-history (cons var swiper-history))))) (if swiper--reveal-mode (progn (reveal-mode 1)))))
swiper--ivy((#(" ;;; avy.el --- Jump to ar..." 0 1 (swiper-line-number "1    " display "1    ") 1 5 (fontified t face font-lock-comment-delimiter-face) 5 111 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "2    " display "2    ")) #(" ;; Copyright (C) 2015  Fr..." 0 1 (swiper-line-number "3    " display "3    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 54 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "4    " display "4    ")) #(" ;; Author: Oleh Krehel <o..." 0 1 (swiper-line-number "5    " display "5    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 45 (fontified t face font-lock-comment-face)) #(" ;; URL: https://github.co..." 0 1 (swiper-line-number "6    " display "6    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 39 (fontified t face font-lock-comment-face)) #(" ;; Version: 0.4.0" 0 1 (swiper-line-number "7    " display "7    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 18 (fontified t face font-lock-comment-face)) #(" ;; Package-Requires: ((em..." 0 1 (swiper-line-number "8    " display "8    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 53 (fontified t face font-lock-comment-face)) #(" ;; Keywords: point, locat..." 0 1 (swiper-line-number "9    " display "9    ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 29 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "10   " display "10   ")) #(" ;; This file is part of G..." 0 1 (swiper-line-number "11   " display "11   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 35 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "12   " display "12   ")) #(" ;; This file is free soft..." 0 1 (swiper-line-number "13   " display "13   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 69 (fontified t face font-lock-comment-face)) #(" ;; it under the terms of ..." 0 1 (swiper-line-number "14   " display "14   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 72 (fontified t face font-lock-comment-face)) #(" ;; the Free Software Foun..." 0 1 (swiper-line-number "15   " display "15   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 71 (fontified t face font-lock-comment-face)) #(" ;; any later version." 0 1 (swiper-line-number "16   " display "16   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 22 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "17   " display "17   ")) #(" ;; This program is distri..." 0 1 (swiper-line-number "18   " display "18   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 67 (fontified t face font-lock-comment-face)) #(" ;; but WITHOUT ANY WARRAN..." 0 1 (swiper-line-number "19   " display "19   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 66 (fontified t face font-lock-comment-face)) #(" ;; MERCHANTABILITY or FIT..." 0 1 (swiper-line-number "20   " display "20   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 65 (fontified t face font-lock-comment-face)) #(" ;; GNU General Public Lic..." 0 1 (swiper-line-number "21   " display "21   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 48 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "22   " display "22   ")) #(" ;; For a full copy of the..." 0 1 (swiper-line-number "23   " display "23   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 53 (fontified t face font-lock-comment-face)) #(" ;; see <http://www.gnu.or..." 0 1 (swiper-line-number "24   " display "24   ") 1 4 (fontified t face font-lock-comment-delimiter-face) 4 39 (fontified t face font-lock-comment-face)) #(" " 0 1 (swiper-line-number "25   " display "25   ")) #(" ;;; Commentary:" 0 1 (swiper-line-number "26   " display "26   ") 1 5 (fontified t face font-lock-comment-delimiter-face) 5 16 (fontified t face font-lock-comment-face)) ...) nil)
swiper()
funcall-interactively(swiper)
call-interactively(swiper nil nil)
command-execute(swiper)
basil-conto added a commit to basil-conto/swiper that referenced this issue May 14, 2019
avy-read et al. can return values that do not correspond to
particular candidates, such as the symbol 'exit'.  This is handled
in avy-process, which sadly doesn't seem reusable in this case.
Ideally, swiper-avy could reuse a higher-level avy API.

Fixes abo-abo#2062
@basil-conto
Copy link
Collaborator

@basil-conto basil-conto commented May 14, 2019

It looks like swiper-avy is duplicating a lot of the logic in avy-process. Ideally avy plumbing would be more generic and make fewer assumptions about what the caller wants to do with a candidate, thus allowing swiper to reuse more of its functions.

I'm not particularly familiar with avy, but #2063 seems to fix this issue.

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented May 14, 2019

Thanks.

astoff added a commit to astoff/swiper that referenced this issue Jan 1, 2021
avy-read et al. can return values that do not correspond to
particular candidates, such as the symbol 'exit'.  This is handled
in avy-process, which sadly doesn't seem reusable in this case.
Ideally, swiper-avy could reuse a higher-level avy API.

Fixes abo-abo#2062
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants