abo-abo / swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
https://oremacs.com/swiper/
2.29k stars 338 forks source link

Lisp error: (void-variable Info-complete-menu-buffer) #1803

Open iquiw opened 5 years ago

iquiw commented 5 years ago

From make plain

  1. M-: (setq debug-on-error t)
  2. M-x info
  3. m (Info-menu)
  4. C-g
  5. M-:
  6. Type something (e.g. a) and press TAB
  7. C-j
Debugger entered--Lisp error: (void-variable Info-complete-menu-buffer) ``` Debugger entered--Lisp error: (void-variable Info-complete-menu-buffer) Info-complete-menu-item("" nil t) all-completions("" Info-complete-menu-item nil) (setq coll (all-completions "" collection predicate)) (cond ((eq collection (function Info-read-node-name-1)) (setq coll (if (equal (and (boundp 'Info-current-file) Info-current-file) "dir") (mapcar (function (lambda (x) (format "(%s)" x))) (delete-dups (all-completions "(" collection predicate))) (all-completions "" collection predicate)))) ((eq collection (function read-file-name-internal)) (if (and (equal def initial-input) (member "./" ivy-extra-directories)) (progn (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 24 (setq def nil)))))) (setq ivy--directory default-directory) (if (and initial-input (not (equal initial-input ""))) (progn (cond ((file-directory-p initial-input) (if (equal (file-name-nondirectory initial-input) "") (progn (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 (setq preselect nil)))) (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 24 (setq def nil)))))) (setq ivy--directory (file-name-as-directory initial-input)) (setq initial-input nil) (if preselect (progn (let ((preselect-directory (file-name-directory preselect))) (if (and preselect-directory (not (equal (expand-file-name preselect-directory) (expand-file-name ivy--directory)))) (progn (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 (setq preselect nil)))))))))) ((condition-case nil (progn (file-exists-p (file-name-directory initial-input))) (error nil)) (setq ivy--directory (file-name-directory initial-input)) (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 (file-name-nondirectory initial-input)))))))) (require 'dired) (if preselect (progn (let ((preselect-directory (ivy--parent-dir preselect))) (if (and preselect-directory (not (string= preselect-directory default-directory))) (progn (setq ivy--directory preselect-directory))) (setq preselect (file-relative-name preselect preselect-directory)) (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 preselect)))))) (setq sort nil) (setq coll (ivy--sorted-files ivy--directory)) (if initial-input (progn (if (or require-match (equal initial-input default-directory) (equal initial-input "")) nil (setq coll (cons initial-input coll))) (if (or (not (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 15))) (equal (ivy--get-action ivy-last) 'identity)) (progn (setq initial-input nil)))))) ((eq collection (function internal-complete-buffer)) (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers predicate))) (dynamic-collection (setq coll (funcall collection ivy-text))) ((consp (car-safe collection)) (setq collection (cl-remove-if-not predicate collection)) (if (and sort (setq sort-fn (ivy--sort-function caller))) (progn (setq collection (sort (copy-sequence collection) sort-fn)) (setq sort nil))) (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 2 collection))) (setq coll (let ((i -1)) (mapcar (function (lambda (x) (propertize x 'idx (setq i (1+ i))))) (all-completions "" collection))))) ((or (functionp collection) (byte-code-function-p collection) (vectorp collection) (hash-table-p collection) (and (listp collection) (symbolp (car collection)))) (setq coll (all-completions "" collection predicate))) (t (setq coll (if predicate (cl-remove-if-not predicate collection) collection)))) (let (coll sort-fn) (cond ((eq collection (function Info-read-node-name-1)) (setq coll (if (equal (and (boundp 'Info-current-file) Info-current-file) "dir") (mapcar (function (lambda (x) (format "(%s)" x))) (delete-dups (all-completions "(" collection predicate))) (all-completions "" collection predicate)))) ((eq collection (function read-file-name-internal)) (if (and (equal def initial-input) (member "./" ivy-extra-directories)) (progn (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 24 (setq def nil)))))) (setq ivy--directory default-directory) (if (and initial-input (not (equal initial-input ""))) (progn (cond ((file-directory-p initial-input) (if (equal (file-name-nondirectory initial-input) "") (progn (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 (setq preselect nil)))) (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 24 (setq def nil)))))) (setq ivy--directory (file-name-as-directory initial-input)) (setq initial-input nil) (if preselect (progn (let ((preselect-directory (file-name-directory preselect))) (if (and preselect-directory (not (equal (expand-file-name preselect-directory) (expand-file-name ivy--directory)))) (progn (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 (setq preselect nil)))))))))) ((condition-case nil (progn (file-exists-p (file-name-directory initial-input))) (error nil)) (setq ivy--directory (file-name-directory initial-input)) (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 (file-name-nondirectory initial-input)))))))) (require 'dired) (if preselect (progn (let ((preselect-directory (ivy--parent-dir preselect))) (if (and preselect-directory (not (string= preselect-directory default-directory))) (progn (setq ivy--directory preselect-directory))) (setq preselect (file-relative-name preselect preselect-directory)) (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 preselect)))))) (setq sort nil) (setq coll (ivy--sorted-files ivy--directory)) (if initial-input (progn (if (or require-match (equal initial-input default-directory) (equal initial-input "")) nil (setq coll (cons initial-input coll))) (if (or (not (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 15))) (equal (ivy--get-action ivy-last) 'identity)) (progn (setq initial-input nil)))))) ((eq collection (function internal-complete-buffer)) (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers predicate))) (dynamic-collection (setq coll (funcall collection ivy-text))) ((consp (car-safe collection)) (setq collection (cl-remove-if-not predicate collection)) (if (and sort (setq sort-fn (ivy--sort-function caller))) (progn (setq collection (sort (copy-sequence collection) sort-fn)) (setq sort nil))) (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 2 collection))) (setq coll (let ((i -1)) (mapcar (function (lambda (x) (propertize x 'idx (setq i (1+ i))))) (all-completions "" collection))))) ((or (functionp collection) (byte-code-function-p collection) (vectorp collection) (hash-table-p collection) (and (listp collection) (symbolp (car collection)))) (setq coll (all-completions "" collection predicate))) (t (setq coll (if predicate (cl-remove-if-not predicate collection) collection)))) (if (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 19)) nil (setq coll (delete "" coll))) (if def (progn (cond ((listp def) (setq coll (cl-union def coll :test (function equal)))) ((not (member def coll)) (setq coll (cons def coll)))))) (if (and sort (or (functionp collection) (not (eq history 'org-refile-history))) (setq sort-fn (ivy--sort-function (if (functionp collection) collection caller))) (null (nthcdr ivy-sort-max-size coll))) (progn (setq coll (sort (copy-sequence coll) sort-fn)))) (setq coll (ivy--set-candidates coll)) (setq ivy--old-re nil) (setq ivy--old-cands nil) (if (integerp preselect) (progn (setq ivy--old-re "") (ivy-set-index preselect))) (if initial-input (progn (setq ivy--old-cands coll) (setq ivy--old-cands (ivy--filter initial-input coll)))) (setq ivy--all-candidates coll) (if (integerp preselect) nil (ivy-set-index (or (and dynamic-collection ivy--index) (and preselect (ivy--preselect-index preselect (if initial-input ivy--old-cands coll))) 0)))) (let* ((prompt (or (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 1)) "")) (collection (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 2))) (predicate (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 3))) (history (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 6))) (preselect (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 7))) (re-builder (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 17))) (dynamic-collection (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 19))) (require-match (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 4))) (caller (or (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 22)) this-command)) (sort (or (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 10)) (assoc caller ivy-sort-functions-alist))) (initial-input (or (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 5)) (cdr (assq caller ivy-initial-inputs-alist)))) (def (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 24)))) (setq ivy--directory nil) (setq ivy-case-fold-search ivy-case-fold-search-default) (setq ivy--regex-function (or re-builder (and (functionp collection) (cdr (assq collection ivy-re-builders-alist))) (ivy-alist-setting ivy-re-builders-alist) (function ivy--regex))) (setq ivy--subexps 0) (setq ivy--regexp-quote (function regexp-quote)) (setq ivy--old-text "") (setq ivy--full-length nil) (setq ivy-text "") (setq ivy--index 0) (setq ivy-calling nil) (setq ivy-use-ignore ivy-use-ignore-default) (setq ivy--highlight-function (or (cdr (assq ivy--regex-function ivy-highlight-functions-alist)) (function ivy--highlight-default))) (let (coll sort-fn) (cond ((eq collection (function Info-read-node-name-1)) (setq coll (if (equal (and (boundp 'Info-current-file) Info-current-file) "dir") (mapcar (function (lambda (x) (format "(%s)" x))) (delete-dups (all-completions "(" collection predicate))) (all-completions "" collection predicate)))) ((eq collection (function read-file-name-internal)) (if (and (equal def initial-input) (member "./" ivy-extra-directories)) (progn (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 24 (setq def nil)))))) (setq ivy--directory default-directory) (if (and initial-input (not (equal initial-input ""))) (progn (cond ((file-directory-p initial-input) (if (equal (file-name-nondirectory initial-input) "") (progn (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 (setq preselect nil)))) (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 24 (setq def nil)))))) (setq ivy--directory (file-name-as-directory initial-input)) (setq initial-input nil) (if preselect (progn (let ((preselect-directory (file-name-directory preselect))) (if (and preselect-directory (not (equal (expand-file-name preselect-directory) (expand-file-name ivy--directory)))) (progn (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 (setq preselect nil)))))))))) ((condition-case nil (progn (file-exists-p (file-name-directory initial-input))) (error nil)) (setq ivy--directory (file-name-directory initial-input)) (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 (file-name-nondirectory initial-input)))))))) (require 'dired) (if preselect (progn (let ((preselect-directory (ivy--parent-dir preselect))) (if (and preselect-directory (not (string= preselect-directory default-directory))) (progn (setq ivy--directory preselect-directory))) (setq preselect (file-relative-name preselect preselect-directory)) (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (let* ((v state)) (aset v 7 preselect)))))) (setq sort nil) (setq coll (ivy--sorted-files ivy--directory)) (if initial-input (progn (if (or require-match (equal initial-input default-directory) (equal initial-input "")) nil (setq coll (cons initial-input coll))) (if (or (not (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 15))) (equal (ivy--get-action ivy-last) 'identity)) (progn (setq initial-input nil)))))) ((eq collection (function internal-complete-buffer)) (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers predicate))) (dynamic-collection (setq coll (funcall collection ivy-text))) ((consp (car-safe collection)) (setq collection (cl-remove-if-not predicate collection)) (if (and sort (setq sort-fn (ivy--sort-function caller))) (progn (setq collection (sort (copy-sequence collection) sort-fn)) (setq sort nil))) (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 2 collection))) (setq coll (let ((i -1)) (mapcar (function (lambda (x) (propertize x 'idx (setq i (1+ i))))) (all-completions "" collection))))) ((or (functionp collection) (byte-code-function-p collection) (vectorp collection) (hash-table-p collection) (and (listp collection) (symbolp (car collection)))) (setq coll (all-completions "" collection predicate))) (t (setq coll (if predicate (cl-remove-if-not predicate collection) collection)))) (if (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 19)) nil (setq coll (delete "" coll))) (if def (progn (cond ((listp def) (setq coll (cl-union def coll :test (function equal)))) ((not (member def coll)) (setq coll (cons def coll)))))) (if (and sort (or (functionp collection) (not (eq history 'org-refile-history))) (setq sort-fn (ivy--sort-function (if (functionp collection) collection caller))) (null (nthcdr ivy-sort-max-size coll))) (progn (setq coll (sort (copy-sequence coll) sort-fn)))) (setq coll (ivy--set-candidates coll)) (setq ivy--old-re nil) (setq ivy--old-cands nil) (if (integerp preselect) (progn (setq ivy--old-re "") (ivy-set-index preselect))) (if initial-input (progn (setq ivy--old-cands coll) (setq ivy--old-cands (ivy--filter initial-input coll)))) (setq ivy--all-candidates coll) (if (integerp preselect) nil (ivy-set-index (or (and dynamic-collection ivy--index) (and preselect (ivy--preselect-index preselect (if initial-input ivy--old-cands coll))) 0)))) (setq ivy-exit nil) (setq ivy--default (if (region-active-p) (buffer-substring (region-beginning) (region-end)) (ivy-thing-at-point))) (setq ivy--prompt (ivy-add-prompt-count prompt)) (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 5 initial-input)))) ivy--reset-state(#s(ivy-state :prompt "Menu item: " :collection Info-complete-menu-item :predicate nil :require-match t :initial-input nil :history nil :preselect "" :keymap nil :update-fn nil :sort t :frame # :window # :buffer # :text nil :action (1 ("o" identity "default") ("i" (closure (bookmark-alist recentf-list avy-styles-alist avy-style avy-keys-alist avy-keys avy-action avy-all-windows cl-struct-ivy-state-tags t) (x) (insert (if (stringp x) x (car x)))) "insert") ("w" (closure (bookmark-alist recentf-list avy-styles-alist avy-style avy-keys-alist avy-keys avy-action avy-all-windows cl-struct-ivy-state-tags t) (x) (kill-new (if (stringp x) x (car x)))) "copy")) :unwind nil :re-builder nil :matcher nil :dynamic-collection nil :display-transformer-fn nil :directory "c:/Shared/app/emacs/share/info/" :caller Info-complete-menu-item :current "" :def "")) (progn (ivy--reset-state (setq ivy-last ivy-recursive-last))) (if (and ivy-recursive-last ivy-recursive-restore (not (eq ivy-last ivy-recursive-last))) (progn (ivy--reset-state (setq ivy-last ivy-recursive-last)))) ivy-recursive-restore() (unwind-protect (funcall action x) (ivy-recursive-restore)) (prog1 (unwind-protect (funcall action x) (ivy-recursive-restore)) (if (or (eq ivy-exit 'done) (minibuffer-window-active-p (selected-window)) (null (active-minibuffer-window))) nil (select-window (active-minibuffer-window)))) (if (eq action (function identity)) (funcall action x) (select-window (ivy--get-window ivy-last)) (set-buffer (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 13))) (prog1 (unwind-protect (funcall action x) (ivy-recursive-restore)) (if (or (eq ivy-exit 'done) (minibuffer-window-active-p (selected-window)) (null (active-minibuffer-window))) nil (select-window (active-minibuffer-window))))) (let* ((collection (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 2))) (current (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))) (x (cond ((and (consp (car-safe collection)) (let ((idx (get-text-property 0 'idx current))) (if idx (nth idx collection) (assoc current collection))))) (ivy--directory (expand-file-name current ivy--directory)) ((equal current "") ivy-text) (t current)))) (if (eq action (function identity)) (funcall action x) (select-window (ivy--get-window ivy-last)) (set-buffer (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 13))) (prog1 (unwind-protect (funcall action x) (ivy-recursive-restore)) (if (or (eq ivy-exit 'done) (minibuffer-window-active-p (selected-window)) (null (active-minibuffer-window))) nil (select-window (active-minibuffer-window)))))) (progn (let* ((collection (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 2))) (current (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))) (x (cond ((and (consp (car-safe collection)) (let ((idx (get-text-property 0 'idx current))) (if idx (nth idx collection) (assoc current collection))))) (ivy--directory (expand-file-name current ivy--directory)) ((equal current "") ivy-text) (t current)))) (if (eq action (function identity)) (funcall action x) (select-window (ivy--get-window ivy-last)) (set-buffer (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 13))) (prog1 (unwind-protect (funcall action x) (ivy-recursive-restore)) (if (or (eq ivy-exit 'done) (minibuffer-window-active-p (selected-window)) (null (active-minibuffer-window))) nil (select-window (active-minibuffer-window))))))) (if action (progn (let* ((collection (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 2))) (current (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))) (x (cond ((and (consp (car-safe collection)) (let ((idx (get-text-property 0 'idx current))) (if idx (nth idx collection) (assoc current collection))))) (ivy--directory (expand-file-name current ivy--directory)) ((equal current "") ivy-text) (t current)))) (if (eq action (function identity)) (funcall action x) (select-window (ivy--get-window ivy-last)) (set-buffer (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 13))) (prog1 (unwind-protect (funcall action x) (ivy-recursive-restore)) (if (or (eq ivy-exit 'done) (minibuffer-window-active-p (selected-window)) (null (active-minibuffer-window))) nil (select-window (active-minibuffer-window)))))))) (let ((action (and (not ivy-inhibit-action) (ivy--get-action ivy-last)))) (if action (progn (let* ((collection (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 2))) (current (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))) (x (cond ((and (consp (car-safe collection)) (let ((idx (get-text-property 0 'idx current))) (if idx (nth idx collection) (assoc current collection))))) (ivy--directory (expand-file-name current ivy--directory)) ((equal current "") ivy-text) (t current)))) (if (eq action (function identity)) (funcall action x) (select-window (ivy--get-window ivy-last)) (set-buffer (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 13))) (prog1 (unwind-protect (funcall action x) (ivy-recursive-restore)) (if (or (eq ivy-exit 'done) (minibuffer-window-active-p (selected-window)) (null (active-minibuffer-window))) nil (select-window (active-minibuffer-window))))))))) ivy-call() (prog1 (unwind-protect (let ((fun (function ivy--minibuffer-setup)) setup-hook) (setq setup-hook (function (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 (cond ((display-graphic-p) nil) ((null resize-mini-windows) 'grow-only) (t resize-mini-windows)))) (if (and ivy-auto-select-single-candidate (= (length ivy--all-candidates) 1)) (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 (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)) ivy-text))) (if (equal item "") nil (set hist (cons (propertize item 'ivy-index ivy--index) (delete item (cdr (symbol-value 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))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook (function 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))) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (let ((cur (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-list-of-text-properties 0 (length cur) '(idx) cur))) (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 (window-minibuffer-p) nil (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 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 (function ivy--minibuffer-setup)) setup-hook) (setq setup-hook (function (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 (cond ((display-graphic-p) nil) ((null resize-mini-windows) 'grow-only) (t resize-mini-windows)))) (if (and ivy-auto-select-single-candidate (= (length ivy--all-candidates) 1)) (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 (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)) ivy-text))) (if (equal item "") nil (set hist (cons (propertize item 'ivy-index ivy--index) (delete item (cdr (symbol-value 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))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook (function 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))) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (let ((cur (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-list-of-text-properties 0 (length cur) '(idx) cur)))) (progn (let ((extra-actions (delete-dups (append (plist-get ivy--actions-list t) (plist-get ivy--actions-list this-command) (plist-get ivy--actions-list caller))))) (if extra-actions (progn (setq action (cond ((functionp action) (cons 1 (cons (cons "o" (cons action '("default"))) extra-actions))) ((null action) (cons 1 (cons '("o" identity "default") extra-actions))) (t (delete-dups (append action extra-actions)))))))) (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 ((source (car --dolist-tail--))) (cond ((equal source '(original-source)) (setq ivy--extra-candidates (cons source ivy--extra-candidates))) ((null (cdr source)) (setq ivy--extra-candidates (cons (list (car source) (funcall (car source))) ivy--extra-candidates)))) (setq --dolist-tail-- (cdr --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 (window-minibuffer-p) nil (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 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 (function ivy--minibuffer-setup)) setup-hook) (setq setup-hook (function (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 (cond ((display-graphic-p) nil) ((null resize-mini-windows) 'grow-only) (t resize-mini-windows)))) (if (and ivy-auto-select-single-candidate (= (length ivy--all-candidates) 1)) (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 (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)) ivy-text))) (if (equal item "") nil (set hist (cons (propertize item 'ivy-index ivy--index) (delete item (cdr (symbol-value 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))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook (function 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))) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (let ((cur (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-list-of-text-properties 0 (length cur) '(idx) cur))))) (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 ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:predicate :require-match :initial-input :history :preselect :def :keymap :update-fn :sort :action :unwind :re-builder :matcher :dynamic-collection :caller)" (car --cl-keys--)))))) (progn (let ((extra-actions (delete-dups (append (plist-get ivy--actions-list t) (plist-get ivy--actions-list this-command) (plist-get ivy--actions-list caller))))) (if extra-actions (progn (setq action (cond ((functionp action) (cons 1 (cons (cons "o" (cons action '("default"))) extra-actions))) ((null action) (cons 1 (cons '("o" identity "default") extra-actions))) (t (delete-dups (append action extra-actions)))))))) (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 ((source (car --dolist-tail--))) (cond ((equal source '(original-source)) (setq ivy--extra-candidates (cons source ivy--extra-candidates))) ((null (cdr source)) (setq ivy--extra-candidates (cons (list (car source) (funcall (car source))) ivy--extra-candidates)))) (setq --dolist-tail-- (cdr --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 (window-minibuffer-p) nil (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 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 (function ivy--minibuffer-setup)) setup-hook) (setq setup-hook (function (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 (cond ((display-graphic-p) nil) ((null resize-mini-windows) 'grow-only) (t resize-mini-windows)))) (if (and ivy-auto-select-single-candidate (= (length ivy--all-candidates) 1)) (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 (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)) ivy-text))) (if (equal item "") nil (set hist (cons (propertize item 'ivy-index ivy--index) (delete item (cdr (symbol-value 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))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook (function 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))) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (let ((cur (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-list-of-text-properties 0 (length cur) '(idx) cur)))))) (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--) '(: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 ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:predicate :require-match :initial-input :history :preselect :def :keymap :update-fn :sort :action :unwind :re-builder :matcher :dynamic-collection :caller)" (car --cl-keys--)))))) (progn (let ((extra-actions (delete-dups (append (plist-get ivy--actions-list t) (plist-get ivy--actions-list this-command) (plist-get ivy--actions-list caller))))) (if extra-actions (progn (setq action (cond ((functionp action) (cons 1 (cons (cons "o" (cons action '("default"))) extra-actions))) ((null action) (cons 1 (cons '("o" identity "default") extra-actions))) (t (delete-dups (append action extra-actions)))))))) (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 ((source (car --dolist-tail--))) (cond ((equal source '(original-source)) (setq ivy--extra-candidates (cons source ivy--extra-candidates))) ((null (cdr source)) (setq ivy--extra-candidates (cons (list (car source) (funcall (car source))) ivy--extra-candidates)))) (setq --dolist-tail-- (cdr --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 (window-minibuffer-p) nil (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 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 (function ivy--minibuffer-setup)) setup-hook) (setq setup-hook (function (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 (cond ((display-graphic-p) nil) ((null resize-mini-windows) 'grow-only) (t resize-mini-windows)))) (if (and ivy-auto-select-single-candidate (= (length ivy--all-candidates) 1)) (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 (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)) ivy-text))) (if (equal item "") nil (set hist (cons (propertize item 'ivy-index ivy--index) (delete item (cdr (symbol-value 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))) (put 'post-command-hook 'permanent-local nil) (remove-hook 'post-command-hook (function 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))) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (let ((cur (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-list-of-text-properties 0 (length cur) '(idx) cur))))))) ivy-read("(a): " ("auth-source-debug" "adaptive-fill-mode" "auto-save-list-file-prefix" "abbrev-expand-function" "attempt-stack-overflow-recovery" "abbrev-table-name-list" "automatic-hscrolling" "auto-save--timer" "autoarg-kp-mode" "auto-composition-mode" "auto-compression-mode" "allout-auto-activation" "auto-insert-mode" "async-shell-command-buffer" "abbrev-mode-hook" "after-revert-hook" "auth-source-cache-expiry" "auto-composition-mode-hook" "auto-save-visited-mode" "auto-save-visited-mode-hook" "abbrev-start-location-buffer" "ansi-color-apply-face-function" "after-change-functions" "auto-raise-tool-bar-buttons" "auto-coding-functions" "auto-compression-mode-hook" "allout-widgets-auto-activation" "auth-source-backend-parser-functions" "advice--buffer-local-function-sample" "auto-save-interval" "auto-save-mode-hook" "advice--bytecodes" "auto-save-list-file-name" "auto-fill-function" "abbrev-all-caps" "auto-window-vscroll" "auto-fill-mode-hook" "argi" "advertised-signature-table" "argv" "ascii-case-table" "after-change-major-mode-hook" "auth-source-creation-defaults" "ad-default-compilation-action" "auto-save-file-name-transforms" "ansi-color-for-comint-mode" "auto-raise-mode-hook" "auth-source-save-behavior" "alternate-fontname-alist" "adaptive-fill-first-line-regexp" "ansi-color-parameter-regexp" "auto-mode-interpreter-regexp" "abbrev-expand-functions" "auth-source-passphrase-alist" "auto-image-file-mode" "auth-sources" "attempt-orderly-shutdown-on-fatal-signal" "adaptive-fill-function" "abbrev-file-name" "auth-source-netrc-cache" "abbreviated-home-dir" "auto-mode-alist" "auth-source-gpg-encrypt-to" "auto-mode-case-fold" "add-log-full-name" "auto-coding-regexp-alist" "abbrev-mode" "auth-source-creation-prompts" "auth-source-protocols-customize" "ansi-color-names-vector" "add-log-current-defun-function" "auto-lower-mode-hook" "after-make-frame-functions" "after-init-hook" "auto-save-visited-file-name" "ansi-color-control-seq-regexp" "ansi-color-context-region" "auto-resize-tool-bars" "auto-fill-inhibit-regexp" "auth-source-backend" "auto-save-default" "auto-fill-chars" "after-load-alist" "auth-source-protocols" "ansi-color-context" "ad-redefinition-action" "auto-composition-function" "abbrev-minor-mode-table-alist" "arabic-shaper-ZWNJ-handling" "after-init-time" "after-setting-font-hook" "add-log-mailing-address" "activate-mark-hook" "ansi-color-map" "abbrevs-changed" "after-load-functions" "automount-dir-prefix" "async-shell-command-display-buffer" "ansi-color-faces-vector" "auth-source-do-cache" "auto-hscroll-mode" "adaptive-fill-regexp" "auto-save-timeout" "after-save-hook" "after-insert-file-functions" "auto-save-include-big-deletions" "advice--where-alist" "abbrev-map" "auth-source-netrc-use-gpg-tokens" "abbrev-start-location" "auto-encryption-mode-hook" "auto-save-visited-interval" "async-bytecomp-package-mode" "auto-encryption-mode" "autoarg-mode" "arabic-shape-log" "activate-menubar-hook" "auto-save-hook" "auto-coding-alist") :predicate nil :initial-input "a" :sort t :action ivy-completion-in-region-action :unwind (closure ((prompt . "(a): ") (w . 3) (initial . "a") (str-len . 1) (len . 1) (comps "auth-source-debug" "adaptive-fill-mode" "auto-save-list-file-prefix" "abbrev-expand-function" "attempt-stack-overflow-recovery" "abbrev-table-name-list" "automatic-hscrolling" "auto-save--timer" "autoarg-kp-mode" "auto-composition-mode" "auto-compression-mode" "allout-auto-activation" "auto-insert-mode" "async-shell-command-buffer" "abbrev-mode-hook" "after-revert-hook" "auth-source-cache-expiry" "auto-composition-mode-hook" "auto-save-visited-mode" "auto-save-visited-mode-hook" "abbrev-start-location-buffer" "ansi-color-apply-face-function" "after-change-functions" "auto-raise-tool-bar-buttons" "auto-coding-functions" "auto-compression-mode-hook" "allout-widgets-auto-activation" "auth-source-backend-parser-functions" "advice--buffer-local-function-sample" "auto-save-interval" "auto-save-mode-hook" "advice--bytecodes" "auto-save-list-file-name" "auto-fill-function" "abbrev-all-caps" "auto-window-vscroll" "auto-fill-mode-hook" "argi" "advertised-signature-table" "argv" "ascii-case-table" "after-change-major-mode-hook" "auth-source-creation-defaults" "ad-default-compilation-action" "auto-save-file-name-transforms" "ansi-color-for-comint-mode" "auto-raise-mode-hook" "auth-source-save-behavior" "alternate-fontname-alist" "adaptive-fill-first-line-regexp" "ansi-color-parameter-regexp" "auto-mode-interpreter-regexp" "abbrev-expand-functions" "auth-source-passphrase-alist" "auto-image-file-mode" "auth-sources" "attempt-orderly-shutdown-on-fatal-signal" "adaptive-fill-function" "abbrev-file-name" "auth-source-netrc-cache" "abbreviated-home-dir" "auto-mode-alist" "auth-source-gpg-encrypt-to" "auto-mode-case-fold" "add-log-full-name" "auto-coding-regexp-alist" "abbrev-mode" "auth-source-creation-prompts" "auth-source-protocols-customize" "ansi-color-names-vector" "add-log-current-defun-function" "auto-lower-mode-hook" "after-make-frame-functions" "after-init-hook" "auto-save-visited-file-name" "ansi-color-control-seq-regexp" "ansi-color-context-region" "auto-resize-tool-bars" "auto-fill-inhibit-regexp" "auth-source-backend" "auto-save-default" "auto-fill-chars" "after-load-alist" "auth-source-protocols" "ansi-color-context" "ad-redefinition-action" "auto-composition-function" "abbrev-minor-mode-table-alist" "arabic-shaper-ZWNJ-handling" "after-init-time" "after-setting-font-hook" "add-log-mailing-address" "activate-mark-hook" "ansi-color-map" "abbrevs-changed" "after-load-functions" "automount-dir-prefix" "async-shell-command-display-buffer" "ansi-color-faces-vector" "auth-source-do-cache" "auto-hscroll-mode" "adaptive-fill-regexp" "auto-save-timeout" "after-save-hook" "after-insert-file-functions" "auto-save-include-big-deletions" "advice--where-alist" "abbrev-map" "auth-source-netrc-use-gpg-tokens" "abbrev-start-location" "auto-encryption-mode-hook" "auto-save-visited-interval" "async-bytecomp-package-mode" "auto-encryption-mode" "autoarg-mode" "arabic-shape-log" "activate-menubar-hook" "auto-save-hook" "auto-coding-alist") (str . "a") (predicate) (collection . #f(compiled-function (string pred action) #)) (end . 8) (start . #) avy-styles-alist avy-style avy-keys-alist avy-keys avy-action avy-all-windows cl-struct-ivy-state-tags t) nil (if (eq ivy-exit 'done) nil (goto-char ivy-completion-beg) (insert initial))) :caller ivy-completion-in-region) (and (ivy-read (if (string= ivy-count-format "") prompt (replace-regexp-in-string "%" "%%" prompt)) (mapcar (function (lambda (s) (remove-text-properties 0 (length s) '(face) s) s)) comps) :predicate nil :initial-input initial :sort t :action (function ivy-completion-in-region-action) :unwind (function (lambda nil (if (eq ivy-exit 'done) nil (goto-char ivy-completion-beg) (insert initial)))) :caller 'ivy-completion-in-region) t) (let* ((w (1+ (floor (log (length comps) 10)))) (ivy-count-format (if (string= ivy-count-format "") ivy-count-format (format "%%-%dd " w))) (prompt (format "(%s): " str))) (and (ivy-read (if (string= ivy-count-format "") prompt (replace-regexp-in-string "%" "%%" prompt)) (mapcar (function (lambda (s) (remove-text-properties 0 (length s) '(face) s) s)) comps) :predicate nil :initial-input initial :sort t :action (function ivy-completion-in-region-action) :unwind (function (lambda nil (if (eq ivy-exit 'done) nil (goto-char ivy-completion-beg) (insert initial)))) :caller 'ivy-completion-in-region) t)) (if (null (cdr comps)) (progn (if (minibuffer-window-active-p (selected-window)) nil (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 12 (selected-window))))) (ivy-completion-in-region-action (substring-no-properties (car comps)))) (let* ((w (1+ (floor (log (length comps) 10)))) (ivy-count-format (if (string= ivy-count-format "") ivy-count-format (format "%%-%dd " w))) (prompt (format "(%s): " str))) (and (ivy-read (if (string= ivy-count-format "") prompt (replace-regexp-in-string "%" "%%" prompt)) (mapcar (function (lambda (s) (remove-text-properties 0 (length s) '(face) s) s)) comps) :predicate nil :initial-input initial :sort t :action (function ivy-completion-in-region-action) :unwind (function (lambda nil (if (eq ivy-exit 'done) nil (goto-char ivy-completion-beg) (insert initial)))) :caller 'ivy-completion-in-region) t))) (let* ((len (ivy-completion-common-length (car comps))) (str-len (length str)) (initial (cond ((= len 0) "") ((> len str-len) (setq len str-len) str) (t (substring str (- len)))))) (setq ivy--old-re nil) (if (ivy--filter initial comps) nil (setq initial nil)) (delete-region (- end len) end) (setq ivy-completion-beg (- end len)) (setq ivy-completion-end ivy-completion-beg) (if (null (cdr comps)) (progn (if (minibuffer-window-active-p (selected-window)) nil (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 12 (selected-window))))) (ivy-completion-in-region-action (substring-no-properties (car comps)))) (let* ((w (1+ (floor (log (length comps) 10)))) (ivy-count-format (if (string= ivy-count-format "") ivy-count-format (format "%%-%dd " w))) (prompt (format "(%s): " str))) (and (ivy-read (if (string= ivy-count-format "") prompt (replace-regexp-in-string "%" "%%" prompt)) (mapcar (function (lambda (s) (remove-text-properties 0 (length s) '(face) s) s)) comps) :predicate nil :initial-input initial :sort t :action (function ivy-completion-in-region-action) :unwind (function (lambda nil (if (eq ivy-exit 'done) nil (goto-char ivy-completion-beg) (insert initial)))) :caller 'ivy-completion-in-region) t)))) (cond ((null comps) (message "No matches")) ((progn (nconc comps nil) (and (null (cdr comps)) (string= str (car comps)))) (message "Sole match")) (t (let* ((len (ivy-completion-common-length (car comps))) (str-len (length str)) (initial (cond ((= len 0) "") ((> len str-len) (setq len str-len) str) (t (substring str (- len)))))) (setq ivy--old-re nil) (if (ivy--filter initial comps) nil (setq initial nil)) (delete-region (- end len) end) (setq ivy-completion-beg (- end len)) (setq ivy-completion-end ivy-completion-beg) (if (null (cdr comps)) (progn (if (minibuffer-window-active-p (selected-window)) nil (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 12 (selected-window))))) (ivy-completion-in-region-action (substring-no-properties (car comps)))) (let* ((w (1+ (floor (log (length comps) 10)))) (ivy-count-format (if (string= ivy-count-format "") ivy-count-format (format "%%-%dd " w))) (prompt (format "(%s): " str))) (and (ivy-read (if (string= ivy-count-format "") prompt (replace-regexp-in-string "%" "%%" prompt)) (mapcar (function (lambda (s) (remove-text-properties 0 (length s) '(face) s) s)) comps) :predicate nil :initial-input initial :sort t :action (function ivy-completion-in-region-action) :unwind (function (lambda nil (if (eq ivy-exit 'done) nil (goto-char ivy-completion-beg) (insert initial)))) :caller 'ivy-completion-in-region) t)))))) (let* ((enable-recursive-minibuffers t) (str (buffer-substring-no-properties start end)) (completion-ignore-case (ivy--case-fold-p str)) (comps (completion-all-completions str collection predicate (- end start))) (ivy--prompts-list (if (window-minibuffer-p) ivy--prompts-list (list (function ivy-completion-in-region) (function (lambda nil)))))) (cond ((null comps) (message "No matches")) ((progn (nconc comps nil) (and (null (cdr comps)) (string= str (car comps)))) (message "Sole match")) (t (let* ((len (ivy-completion-common-length (car comps))) (str-len (length str)) (initial (cond ((= len 0) "") ((> len str-len) (setq len str-len) str) (t (substring str (- len)))))) (setq ivy--old-re nil) (if (ivy--filter initial comps) nil (setq initial nil)) (delete-region (- end len) end) (setq ivy-completion-beg (- end len)) (setq ivy-completion-end ivy-completion-beg) (if (null (cdr comps)) (progn (if (minibuffer-window-active-p (selected-window)) nil (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 12 (selected-window))))) (ivy-completion-in-region-action (substring-no-properties (car comps)))) (let* ((w (1+ (floor (log (length comps) 10)))) (ivy-count-format (if (string= ivy-count-format "") ivy-count-format (format "%%-%dd " w))) (prompt (format "(%s): " str))) (and (ivy-read (if (string= ivy-count-format "") prompt (replace-regexp-in-string "%" "%%" prompt)) (mapcar (function (lambda (s) (remove-text-properties 0 (length s) '(face) s) s)) comps) :predicate nil :initial-input initial :sort t :action (function ivy-completion-in-region-action) :unwind (function (lambda nil (if (eq ivy-exit 'done) nil (goto-char ivy-completion-beg) (insert initial)))) :caller 'ivy-completion-in-region) t))))))) ivy-completion-in-region(# 8 #f(compiled-function (string pred action) #) nil) completion-in-region(# 8 #f(compiled-function (string pred action) #) nil) completion-at-point() funcall-interactively(completion-at-point) call-interactively(completion-at-point nil nil) command-execute(completion-at-point) read-from-minibuffer("Eval: " nil (keymap (9 . completion-at-point) (27 keymap (9 . completion-at-point)) keymap (18 . counsel-minibuffer-history) (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the minibuffer") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuffer") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\015" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . minibuffer-keyboard-quit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) t read-expression-history) read--expression("Eval: ") byte-code("\301\302!\303\010!B\207" [current-prefix-arg read--expression "Eval: " eval-expression-get-print-arguments] 3) call-interactively(eval-expression nil nil) command-execute(eval-expression) ```

Emacs 26.1, swiper commit: d76968a85f9dc5dcebdc25eb8e3af2cd2775319e

abo-abo commented 5 years ago

Can't reproduce step 3. When I press m, there's no Info-menu candidate, only Info. Please clarify.

iquiw commented 5 years ago

Sorry, the step is just pressing m.

abo-abo commented 5 years ago

Thanks. I think it's a bug in info.el. They declare this variable, but don't define it. Then with C-g the let-bound var goes out of scope, but there's still a reference to the symbol somewhere. I've added a work-around that I think good enough. It might be worthwhile to investigate why there's still a reference to the symbol after C-g. But that would be a general Emacs bug, not related to ivy.

basil-conto commented 5 years ago

I think it's a bug in info.el. They declare this variable, but don't define it.

They do define it: it's dynamically bound in several places in lisp/info.el. That info.el was not designed with Ivy in mind, or that Ivy does not fully support info.el completion (e.g. #1524, #1597), does not make this an Emacs bug.

Then with C-g the let-bound var goes out of scope, but there's still a reference to the symbol somewhere.

I think the "stale" reference is in ivy-recursive-last, which is fed to ivy--reset-state in ivy-recursive-restore as part of ivy-call: https://github.com/abo-abo/swiper/blob/cfef4724968e4968616947bbf0ed50d62ca5c4e1/ivy.el#L1272-L1273

I've added a work-around that I think good enough.

The workaround sets Info-read-node-completion-table, not Info-complete-menu-buffer, to nil, so the issue is not solved.

But that would be a general Emacs bug, not related to ivy.

Though I haven't investigated this beyond what I outlined above, I'm not yet convinced this is Emacs' fault.

basil-conto commented 5 years ago

I've added a work-around that I think good enough.

The workaround sets Info-read-node-completion-table, not Info-complete-menu-buffer, to nil, so the issue is not solved.

What's more, at the point where ivy--reset-state sets Info-read-node-completion-table, the variable is not yet declared special:

In ivy--reset-state:
ivy.el:1922:20:Warning: assignment to free variable
    ‘Info-read-node-completion-table’
abo-abo commented 5 years ago

In my understanding, (defvar x) is a forward declation, not a definition. And (defvar x nil) is a definition. And using an undefined variable is a bug. Of course, it may be legal, but it's unusual for me, i kind of see it as a bug.

basil-conto commented 5 years ago

In my understanding, (defvar x) is a forward declation

More specifically, it declares x as being special in the current scope.

And (defvar x nil) is a definition.

It both makes x special in the current scope and sets its value slot.

And using an undefined variable is a bug.

More specifically, trying to access the value of a void variable is a bug. But info.el doesn't do this. What it does is analogous to the following perfectly valid Elisp:

(defvar my-special-var)

(defun my-foo ()
  (message "%s" my-special-var))

(let ((my-special-var nil))
  (my-foo))

Sure, it may not be the most straightforward way to program something, which is why lexical-binding is generally a superior paradigm, but it's still idiomatic dynamic Elisp. In fact, every time (defvar some-externally-defined-special-var) appears in the Ivy sources we're effectively relying on the same pattern.

Having gotten today's dose of pedantry out of my system, I of course agree that info.el could be written in a nicer way, but that's not really an avenue worth pursuing given that the (potentially quite involved) change wouldn't be visible until Emacs 27.

basil-conto commented 5 years ago

Then with C-g the let-bound var goes out of scope, but there's still a reference to the symbol somewhere.

I think the "stale" reference is in ivy-recursive-last, which is fed to ivy--reset-state in ivy-recursive-restore as part of ivy-call: https://github.com/abo-abo/swiper/blob/cfef4724968e4968616947bbf0ed50d62ca5c4e1/ivy.el#L1272-L1273

@abo-abo Why does ivy-recursive-restore have to "reevaluate" the entire ivy-recursive-last state?

Hopefully a less kludgy solution can be found, but until then, and before we forget about this, #1814 works around the OP.