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

In-buffer Elisp function completion throws #1648

Closed
basil-conto opened this issue Jul 4, 2018 · 1 comment

Comments

@basil-conto
Copy link
Collaborator

commented Jul 4, 2018

1ffcbac introduced the following behaviour:

  1. make plain
  2. M-xtoggle-debug-on-errorRET
  3. (messC-M-i
    • Expected result: In-buffer Elisp function completion

    • Actual result:

      Debugger entered--Lisp error: (wrong-type-argument symbolp "message-wide-reply")
        fboundp("message-wide-reply")
        cl-remove(nil ("message-wide-reply" "message-news" "message" "message-resend" "message-unbold-region" "message-insinuate-rmail" "message-forward-rmail-make-body" "message-or-box" "message-supersede" "message-mail-other-window" "message-cancel-news" "message-box" "messages-buffer-mode" "message-followup" "message-bounce" "message-goto-eoh" "message-forward" "message-bold-region" "message-reply" "message-forward-make-body" "message-mail" "message-mail-other-frame" "message-recover" "message-news-other-frame" "message-news-other-window" "messages-buffer" "message-mode") :if-not fboundp)
        apply(cl-remove nil ("message-wide-reply" "message-news" "message" "message-resend" "message-unbold-region" "message-insinuate-rmail" "message-forward-rmail-make-body" "message-or-box" "message-supersede" "message-mail-other-window" "message-cancel-news" "message-box" "messages-buffer-mode" "message-followup" "message-bounce" "message-goto-eoh" "message-forward" "message-bold-region" "message-reply" "message-forward-make-body" "message-mail" "message-mail-other-frame" "message-recover" "message-news-other-frame" "message-news-other-window" "messages-buffer" "message-mode") :if-not fboundp nil)
        cl-remove-if-not(fboundp ("message-wide-reply" "message-news" "message" "message-resend" "message-unbold-region" "message-insinuate-rmail" "message-forward-rmail-make-body" "message-or-box" "message-supersede" "message-mail-other-window" "message-cancel-news" "message-box" "messages-buffer-mode" "message-followup" "message-bounce" "message-goto-eoh" "message-forward" "message-bold-region" "message-reply" "message-forward-make-body" "message-mail" "message-mail-other-frame" "message-recover" "message-news-other-frame" "message-news-other-window" "messages-buffer" "message-mode"))
        (if predicate (cl-remove-if-not predicate collection) collection)
        (setq coll (if predicate (cl-remove-if-not predicate collection) collection))
        (cond ((eq collection 'Info-read-node-name-1) (if (equal Info-current-file "dir") (setq coll (mapcar #'(lambda (x) (format "(%s)" x)) (cl-delete-duplicates (all-completions "(" collection predicate) :test #'equal))) (setq coll (all-completions "" collection predicate)))) ((eq collection 'read-file-name-internal) (setq ivy--directory default-directory) (if (and initial-input (not (equal initial-input ""))) (progn (cond ((file-directory-p initial-input) (if (equal ... "") (progn ... ...)) (setq ivy--directory initial-input) (setq initial-input nil) (if preselect (progn ...))) ((condition-case nil (progn ...) (error nil)) (setq ivy--directory (file-name-directory initial-input)) (progn (or ... ...) (let* ... ...)))))) (require 'dired) (if preselect (progn (let ((preselect-directory (file-name-directory ...))) (if (or (null preselect-directory) (string= preselect-directory default-directory)) nil (setq ivy--directory preselect-directory)) (progn (or (and ... t) (signal ... ...)) (let* (...) (aset v 7 ...)))))) (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 (and (progn (or ... ...) (aref ivy-last 15)) (not (equal ... ...))) nil (setq initial-input nil))))) ((eq collection 'internal-complete-buffer) (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers predicate))) (dynamic-collection (setq coll (funcall collection ivy-text))) ((and (consp collection) (listp (car collection))) (if (and sort (setq sort-fn (ivy--sort-function caller))) (progn (setq sort nil) (setq coll (mapcar #'car (sort (copy-sequence collection) sort-fn)))) (setq collection (progn (or (and (memq ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... ivy-last))) (let* ((v ivy-last)) (aset v 2 (cl-remove-if-not predicate collection))))) (setq coll (all-completions "" collection))) (let ((i 0)) (condition-case nil (progn (let ((--dolist-tail-- coll)) (while --dolist-tail-- (let ... ... ... ...)))) (error nil)))) ((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 'Info-read-node-name-1) (if (equal Info-current-file "dir") (setq coll (mapcar #'(lambda ... ...) (cl-delete-duplicates (all-completions "(" collection predicate) :test #'equal))) (setq coll (all-completions "" collection predicate)))) ((eq collection 'read-file-name-internal) (setq ivy--directory default-directory) (if (and initial-input (not (equal initial-input ""))) (progn (cond ((file-directory-p initial-input) (if ... ...) (setq ivy--directory initial-input) (setq initial-input nil) (if preselect ...)) ((condition-case nil ... ...) (setq ivy--directory ...) (progn ... ...))))) (require 'dired) (if preselect (progn (let ((preselect-directory ...)) (if (or ... ...) nil (setq ivy--directory preselect-directory)) (progn (or ... ...) (let* ... ...))))) (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 (and (progn ... ...) (not ...)) nil (setq initial-input nil))))) ((eq collection 'internal-complete-buffer) (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers predicate))) (dynamic-collection (setq coll (funcall collection ivy-text))) ((and (consp collection) (listp (car collection))) (if (and sort (setq sort-fn (ivy--sort-function caller))) (progn (setq sort nil) (setq coll (mapcar #'car (sort ... sort-fn)))) (setq collection (progn (or (and ... t) (signal ... ...)) (let* (...) (aset v 2 ...)))) (setq coll (all-completions "" collection))) (let ((i 0)) (condition-case nil (progn (let (...) (while --dolist-tail-- ...))) (error nil)))) ((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 'equal))) ((member def coll)) (t (setq coll (cons def coll)))))) (if sort (progn (if (functionp collection) (if (and (not (eq collection ...)) (<= (length coll) ivy-sort-max-size) (setq sort-fn (ivy--sort-function collection))) (progn (setq coll (sort ... sort-fn)))) (if (and (not (eq history ...)) (<= (length coll) ivy-sort-max-size) (setq sort-fn (ivy--sort-function caller))) (progn (setq coll (sort ... 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 ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... 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))) (sort (progn (or (and (memq (type-of state) cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list 'ivy-state state))) (aref state 10))) (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 ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... state))) (aref state 22)) this-command)) (initial-input (or (progn (or (and (memq ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... 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))) (and caller (cdr (assq caller ivy-re-builders-alist))) (cdr (assq t ivy-re-builders-alist)) #'ivy--regex)) (setq ivy--subexps 0) (setq ivy--regexp-quote #'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)) #'ivy--highlight-default)) (let (coll sort-fn) (cond ((eq collection 'Info-read-node-name-1) (if (equal Info-current-file "dir") (setq coll (mapcar #'... (cl-delete-duplicates ... :test ...))) (setq coll (all-completions "" collection predicate)))) ((eq collection 'read-file-name-internal) (setq ivy--directory default-directory) (if (and initial-input (not (equal initial-input ""))) (progn (cond (... ... ... ... ...) (... ... ...)))) (require 'dired) (if preselect (progn (let (...) (if ... nil ...) (progn ... ...)))) (setq coll (ivy--sorted-files ivy--directory)) (if initial-input (progn (if (or require-match ... ...) nil (setq coll ...)) (if (and ... ...) nil (setq initial-input nil))))) ((eq collection 'internal-complete-buffer) (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers predicate))) (dynamic-collection (setq coll (funcall collection ivy-text))) ((and (consp collection) (listp (car collection))) (if (and sort (setq sort-fn (ivy--sort-function caller))) (progn (setq sort nil) (setq coll (mapcar ... ...))) (setq collection (progn (or ... ...) (let* ... ...))) (setq coll (all-completions "" collection))) (let ((i 0)) (condition-case nil (progn (let ... ...)) (error nil)))) ((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 ...))) ((member def coll)) (t (setq coll (cons def coll)))))) (if sort (progn (if (functionp collection) (if (and (not ...) (<= ... ivy-sort-max-size) (setq sort-fn ...)) (progn (setq coll ...))) (if (and (not ...) (<= ... ivy-sort-max-size) (setq sort-fn ...)) (progn (setq coll ...)))))) (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 "(mess): " :collection ("message-wide-reply" "message-news" "message" "message-resend" "message-unbold-region" "message-insinuate-rmail" "message-forward-rmail-make-body" "message-or-box" "message-supersede" "message-mail-other-window" "message-cancel-news" "message-box" "messages-buffer-mode" "message-followup" "message-bounce" "message-goto-eoh" "message-forward" "message-bold-region" "message-reply" "message-forward-make-body" "message-mail" "message-mail-other-frame" "message-recover" "message-news-other-frame" "message-news-other-window" "messages-buffer" "message-mode") :predicate fboundp :require-match nil :initial-input "mess" :history nil :preselect nil :keymap nil :update-fn nil :sort t :frame #<frame emacs@thunk 0x1422c30> :window #<window 3 on *scratch*> :buffer #<buffer *scratch*> :text nil :action (1 ("o" ivy-completion-in-region-action "default") ("i" (closure (bookmark-alist recentf-list avy-styles-alist avy-style avy-keys-alist avy-keys avy-action avy-all-windows Info-current-file 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 Info-current-file cl-struct-ivy-state-tags t) (x) (kill-new (if (stringp x) x (car x)))) "copy")) :unwind (closure ((prompt . "(mess): ") (w . 2) (initial . "mess") (str-len . 4) (len . 4) (comps #("message-wide-reply" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-news" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-resend" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-unbold-region" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-insinuate-rmail" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-forward-rmail-make-body" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-or-box" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-supersede" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-mail-other-window" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-cancel-news" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-box" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("messages-buffer-mode" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-followup" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-bounce" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-goto-eoh" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-forward" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-bold-region" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-reply" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-forward-make-body" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-mail" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-mail-other-frame" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-recover" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-news-other-frame" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-news-other-window" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("messages-buffer" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-mode" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference)))) (str . "mess") (predicate . fboundp) (collection . [0 0 ada-ref-man epg-context-signers 0 0 kinsoku xselect--int-to-cons magit-submodule-update url-setup-privacy-info epg--status-VALIDSIG junet-dos help-variable 0 0 0 bbdb-toggle-records-layout biblio-core no-activate defun-prompt-regexp _message mixal figlet-preview-fonts pulse-momentary-highlight-region cl-print--preprocess ivy-sort-file-function-default selinux-context byte-compile-function-warn memory-use-counts DXT1 0 0 cl--struct-epg-signature-p ! 0 0 dired-before-readin-hook ibuffer-update Info-apropos-find-file \' 0 M-kp-down * rx-trans-forms muletibetan-2 - not-at-beginning-of-line helm expired 0 ...]) (end . 151) (start . #<marker at 147 in *scratch*>) avy-styles-alist avy-style avy-keys-alist avy-keys avy-action avy-all-windows Info-current-file cl-struct-ivy-state-tags t) nil (if (eq ivy-exit 'done) nil (goto-char ivy-completion-beg) (insert initial))) :re-builder nil :matcher nil :dynamic-collection nil :display-transformer-fn nil :directory "~/.emacs.d/src/swiper/" :caller ivy-completion-in-region :current nil :def nil))
        (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 (cdr (or (assq caller ivy-display-functions-alist) (assq t ivy-display-functions-alist)))))) (height (or (cdr (assq caller ivy-height-alist)) ivy-height))) (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 #'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))) (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))) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (if (> (length (progn (or (and ... t) (signal ... ...)) (aref ivy-last 23))) 0) (progn (remove-list-of-text-properties 0 1 '(idx) (progn (or (and ... t) (signal ... ...)) (aref ivy-last 23)))))))
        (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 ...)) ((null action) (cons 1 ...)) (t (delete-dups ...))))))) (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 (window-minibuffer-p) nil (or ivy-display-function (cdr (or ... ...))))) (height (or (cdr (assq caller ivy-height-alist)) ivy-height))) (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 #'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))) (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))) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (if (> (length (progn (or ... ...) (aref ivy-last 23))) 0) (progn (remove-list-of-text-properties 0 1 '(idx) (progn (or ... ...) (aref ivy-last 23))))))))
        (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 :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 (... ...) (... ...) (t ...)))))) (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 (window-minibuffer-p) nil (or ivy-display-function (cdr ...)))) (height (or (cdr (assq caller ivy-height-alist)) ivy-height))) (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 ...) setup-hook) (setq setup-hook #'...) (unwind-protect (progn ... ...) (remove-hook ... setup-hook))) (remove-hook 'post-command-hook #'ivy--queue-exhibit) (let ((cleanup ...)) (if (functionp cleanup) (progn ...))) (if (setq unwind (progn ... ...)) (progn (funcall unwind))) (if (eq ivy-exit 'done) nil (ivy-recursive-restore))) (ivy-call) (if (> (length (progn ... ...)) 0) (progn (remove-list-of-text-properties 0 1 '... (progn ... ...))))))))
        (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 :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 ... ... ...)))) (if extra-actions (progn (setq action (cond ... ... ...))))) (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 (window-minibuffer-p) nil (or ivy-display-function ...))) (height (or (cdr ...) ivy-height))) (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 (... setup-hook) (setq setup-hook ...) (unwind-protect ... ...)) (remove-hook 'post-command-hook #'ivy--queue-exhibit) (let (...) (if ... ...)) (if (setq unwind ...) (progn ...)) (if (eq ivy-exit ...) nil (ivy-recursive-restore))) (ivy-call) (if (> (length ...) 0) (progn (remove-list-of-text-properties 0 1 ... ...))))))))
        ivy-read("(mess): " ("message-wide-reply" "message-news" "message" "message-resend" "message-unbold-region" "message-insinuate-rmail" "message-forward-rmail-make-body" "message-or-box" "message-supersede" "message-mail-other-window" "message-cancel-news" "message-box" "messages-buffer-mode" "message-followup" "message-bounce" "message-goto-eoh" "message-forward" "message-bold-region" "message-reply" "message-forward-make-body" "message-mail" "message-mail-other-frame" "message-recover" "message-news-other-frame" "message-news-other-window" "messages-buffer" "message-mode") :predicate fboundp :initial-input "mess" :sort t :action ivy-completion-in-region-action :unwind (closure ((prompt . "(mess): ") (w . 2) (initial . "mess") (str-len . 4) (len . 4) (comps #("message-wide-reply" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-news" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-resend" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-unbold-region" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-insinuate-rmail" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-forward-rmail-make-body" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-or-box" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-supersede" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-mail-other-window" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-cancel-news" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-box" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("messages-buffer-mode" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-followup" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-bounce" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-goto-eoh" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-forward" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-bold-region" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-reply" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-forward-make-body" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-mail" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-mail-other-frame" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-recover" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-news-other-frame" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-news-other-window" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("messages-buffer" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference))) #("message-mode" 0 4 (face (completions-common-part)) 4 5 (face (completions-first-difference)))) (str . "mess") (predicate . fboundp) (collection . [0 0 ada-ref-man epg-context-signers 0 0 kinsoku xselect--int-to-cons magit-submodule-update url-setup-privacy-info epg--status-VALIDSIG junet-dos help-variable 0 0 0 bbdb-toggle-records-layout biblio-core no-activate defun-prompt-regexp _message mixal figlet-preview-fonts pulse-momentary-highlight-region cl-print--preprocess ivy-sort-file-function-default selinux-context byte-compile-function-warn memory-use-counts DXT1 0 0 cl--struct-epg-signature-p ! 0 0 dired-before-readin-hook ibuffer-update Info-apropos-find-file \' 0 M-kp-down * rx-trans-forms muletibetan-2 - not-at-beginning-of-line helm expired 0 ...]) (end . 151) (start . #<marker at 147 in *scratch*>) avy-styles-alist avy-style avy-keys-alist avy-keys avy-action avy-all-windows Info-current-file 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 #'substring-no-properties comps) :predicate predicate :initial-input initial :sort t :action #'ivy-completion-in-region-action :unwind #'(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 #'substring-no-properties comps) :predicate predicate :initial-input initial :sort t :action #'ivy-completion-in-region-action :unwind #'(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 #'substring-no-properties comps) :predicate predicate :initial-input initial :sort t :action #'ivy-completion-in-region-action :unwind #'(lambda nil (if (eq ivy-exit ...) 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 ... cl-struct-ivy-state-tags) t) (signal 'wrong-type-argument (list ... 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 ... 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 #'substring-no-properties comps) :predicate predicate :initial-input initial :sort t :action #'ivy-completion-in-region-action :unwind #'(lambda nil (if ... nil ... ...)) :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 ...))))) (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 ... ...) (let* ... ...))) (ivy-completion-in-region-action (substring-no-properties (car comps)))) (let* ((w (1+ ...)) (ivy-count-format (if ... ivy-count-format ...)) (prompt (format "(%s): " str))) (and (ivy-read (if ... prompt ...) (mapcar ... comps) :predicate predicate :initial-input initial :sort t :action #'ivy-completion-in-region-action :unwind #'... :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 #'ivy-completion-in-region #'(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 (... "") (... ... str) (t ...)))) (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 ...) nil (progn ... ...)) (ivy-completion-in-region-action (substring-no-properties ...))) (let* ((w ...) (ivy-count-format ...) (prompt ...)) (and (ivy-read ... ... :predicate predicate :initial-input initial :sort t :action ... :unwind ... :caller ...) t)))))))
        ivy-completion-in-region(#<marker at 147 in *scratch*> 151 [0 0 ada-ref-man epg-context-signers 0 0 kinsoku xselect--int-to-cons magit-submodule-update url-setup-privacy-info epg--status-VALIDSIG junet-dos help-variable 0 0 0 bbdb-toggle-records-layout biblio-core no-activate defun-prompt-regexp _message mixal figlet-preview-fonts pulse-momentary-highlight-region cl-print--preprocess ivy-sort-file-function-default selinux-context byte-compile-function-warn memory-use-counts DXT1 0 0 cl--struct-epg-signature-p ! 0 0 dired-before-readin-hook ibuffer-update Info-apropos-find-file \' 0 M-kp-down * rx-trans-forms muletibetan-2 - not-at-beginning-of-line helm expired 0 ...] fboundp)
        completion-in-region(#<marker at 147 in *scratch*> 151 [0 0 ada-ref-man epg-context-signers 0 0 kinsoku xselect--int-to-cons magit-submodule-update url-setup-privacy-info epg--status-VALIDSIG junet-dos help-variable 0 0 0 bbdb-toggle-records-layout biblio-core no-activate defun-prompt-regexp _message mixal figlet-preview-fonts pulse-momentary-highlight-region cl-print--preprocess ivy-sort-file-function-default selinux-context byte-compile-function-warn memory-use-counts DXT1 0 0 cl--struct-epg-signature-p ! 0 0 dired-before-readin-hook ibuffer-update Info-apropos-find-file \' 0 M-kp-down * rx-trans-forms muletibetan-2 - not-at-beginning-of-line helm expired 0 ...] fboundp)
        completion-at-point()
        funcall-interactively(completion-at-point)
        call-interactively(completion-at-point nil nil)
        command-execute(completion-at-point)
      

This is because, by the time ivy--reset-state is called, ivy-state-collection is a list of strings, and ivy-state-predicate is the function fboundp.

@abo-abo abo-abo closed this in 92efd62 Jul 5, 2018

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Jul 5, 2018

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.