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

C-x p b does not work on Emacs master (28.0.50) #159

Closed
Compro-Prasad opened this issue Aug 5, 2020 · 5 comments
Closed

C-x p b does not work on Emacs master (28.0.50) #159

Compro-Prasad opened this issue Aug 5, 2020 · 5 comments

Comments

@Compro-Prasad
Copy link

In *Messages* buffer:

Error in post-command-hook (selectrum--minibuffer-post-command-hook): (wrong-type-argument listp " *Minibuf-1*")

The prompt does show up even with the above error message but gives another error after I press return on the prompt. The backtrace after pressing return is as follows:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  substring-no-properties(nil)
  prescient-remember(nil)
  selectrum-prescient--remember(nil "Switch to buffer: " #f(compiled-function (input) #<bytecode 0x548c14e7a439a3c>) :default-candidate nil :require-match nil :history buffer-name-history :no-move-default-candidate t :may-modify-candidates t :minibuffer-completion-table internal-complete-buffer :minibuffer-completion-predicate #f(compiled-function (buffer) #<bytecode -0x16253f7de17091c0>))
  run-hook-with-args(selectrum-prescient--remember nil "Switch to buffer: " #f(compiled-function (input) #<bytecode 0x548c14e7a439a3c>) :default-candidate nil :require-match nil :history buffer-name-history :no-move-default-candidate t :may-modify-candidates t :minibuffer-completion-table internal-complete-buffer :minibuffer-completion-predicate #f(compiled-function (buffer) #<bytecode -0x16253f7de17091c0>))
  apply(run-hook-with-args selectrum-candidate-selected-hook nil ("Switch to buffer: " #f(compiled-function (input) #<bytecode 0x548c14e7a439a3c>) :default-candidate nil :require-match nil :history buffer-name-history :no-move-default-candidate t :may-modify-candidates t :minibuffer-completion-table internal-complete-buffer :minibuffer-completion-predicate #f(compiled-function (buffer) #<bytecode -0x16253f7de17091c0>)))
  selectrum--exit-with(nil)
  selectrum-select-current-candidate(nil)
  funcall-interactively(selectrum-select-current-candidate nil)
  call-interactively(selectrum-select-current-candidate nil nil)
  command-execute(selectrum-select-current-candidate)
  read-from-minibuffer("Switch to buffer: " nil (keymap (9 . selectrum-insert-current-candidate) (10 . selectrum-submit-exact-input) (27 keymap (67108991 . backward-kill-sexp)) (remap keymap (previous-matching-history-element . selectrum-select-from-history) (kill-ring-save . selectrum-kill-ring-save) (end-of-buffer . selectrum-goto-end) (beginning-of-buffer . selectrum-goto-beginning) (minibuffer-beginning-of-buffer . selectrum-goto-beginning) (scroll-up-command . selectrum-next-page) (scroll-down-command . selectrum-previous-page) (exit-minibuffer . selectrum-select-current-candidate) (next-line-or-history-element . selectrum-next-candidate) (previous-line-or-history-element . selectrum-previous-candidate) (next-line . selectrum-next-candidate) (previous-line . selectrum-previous-candidate) (minibuffer-keyboard-quit . abort-recursive-edit) (keyboard-quit . abort-recursive-edit)) keymap (remap keymap (previous-matching-history-element . selectrum-select-from-history)) (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (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 "\15" :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 (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil buffer-name-history)
  selectrum-read("Switch to buffer: " #f(compiled-function (input) #<bytecode 0x548c14e7a439a3c>) :default-candidate nil :require-match nil :history buffer-name-history :no-move-default-candidate t :may-modify-candidates t :minibuffer-completion-table internal-complete-buffer :minibuffer-completion-predicate #f(compiled-function (buffer) #<bytecode -0x16253f7de17091c0>))
  selectrum-read-buffer("Switch to buffer: " nil nil #f(compiled-function (buffer) #<bytecode -0x16253f7de17091c0>))
  read-buffer("Switch to buffer: " nil nil #f(compiled-function (buffer) #<bytecode -0x16253f7de17091c0>))
  project--read-project-buffer()
  byte-code("\300 C\207" [project--read-project-buffer] 1)
  call-interactively(project-switch-to-buffer nil nil)
  command-execute(project-switch-to-buffer)
@clemera
Copy link
Collaborator

clemera commented Aug 5, 2020

Thanks! Can you try to get the backtrace of the first error by using force-debug from here?

@okamsn
Copy link
Contributor

okamsn commented Aug 5, 2020

If it helps, on Emacs 28, this is what I get when running the following code from project-switch-to-buffer. I haven't updated Emacs since the 19th of July.

    (let* ((pr (project-current t))
         (current-buffer (current-buffer))
         (other-buffer (other-buffer current-buffer))
         (other-name (buffer-name other-buffer))
         (predicate
          (lambda (buffer)
            ;; BUFFER is an entry (BUF-NAME . BUF-OBJ) of Vbuffer_alist.
            (and (cdr buffer)
                 (equal pr
                        (with-current-buffer (cdr buffer)
                          (project-current)))))))
    (switch-to-buffer
     (read-buffer
      "Switch to buffer: "
      (when (funcall predicate (cons other-name other-buffer))
        other-name)
      nil
      predicate)))
Debugger entered--Lisp error: (wrong-type-argument listp " *Minibuf-1*")
  cdr(" *Minibuf-1*")
  (and (cdr buffer) (equal pr (save-current-buffer (set-buffer (cdr buffer)) (project-current))))
  (closure ((other-name . "*Ibuffer*") (other-buffer . #<buffer *Ibuffer*>) (current-buffer . #<buffer init.el>) (pr vc . "~/.emacs.d/") t) (buffer) (and (cdr buffer) (equal pr (save-current-buffer (set-buffer (cdr buffer)) (project-current)))))(" *Minibuf-1*")
  cl-delete(nil (" *Minibuf-1*" "init.el" " *Minibuf-2*" "*Ibuffer*" " *Minibuf-0*" " *Echo Area 0*" " *Echo Area 1*" " *code-conversion-work*" " *diff-hl* " " *code-converting-work*" " *which-key*" "*Messages*" "*Backtrace*" "*eldoc for use-package*" "*Compile-Log*" "*Warnings*") :if-not (closure ((other-name . "*Ibuffer*") (other-buffer . #<buffer *Ibuffer*>) (current-buffer . #<buffer init.el>) (pr vc . "~/.emacs.d/") t) (buffer) (and (cdr buffer) (equal pr (save-current-buffer (set-buffer (cdr buffer)) (project-current))))))
  cl-delete-if-not((closure ((other-name . "*Ibuffer*") (other-buffer . #<buffer *Ibuffer*>) (current-buffer . #<buffer init.el>) (pr vc . "~/.emacs.d/") t) (buffer) (and (cdr buffer) (equal pr (save-current-buffer (set-buffer (cdr buffer)) (project-current))))) (" *Minibuf-1*" "init.el" " *Minibuf-2*" "*Ibuffer*" " *Minibuf-0*" " *Echo Area 0*" " *Echo Area 1*" " *code-conversion-work*" " *diff-hl* " " *code-converting-work*" " *which-key*" "*Messages*" "*Backtrace*" "*eldoc for use-package*" "*Compile-Log*" "*Warnings*"))
  (if predicate (cl-delete-if-not predicate buffers) buffers)
  (let* ((buffers (mapcar #'buffer-name (buffer-list))) (candidates (if predicate (cl-delete-if-not predicate buffers) buffers))) (if (string-prefix-p " " input) (progn (setq input (substring input 1)) (setq candidates (cl-delete-if-not #'(lambda (name) (string-prefix-p " " name)) candidates))) (setq candidates (cl-delete-if #'(lambda (name) (string-prefix-p " " name)) candidates))) (list (cons 'candidates candidates) (cons 'input input)))
  (closure ((predicate closure ((other-name . "*Ibuffer*") (other-buffer . #<buffer *Ibuffer*>) (current-buffer . #<buffer init.el>) (pr vc . "~/.emacs.d/") t) (buffer) (and (cdr buffer) (equal pr (save-current-buffer (set-buffer ...) (project-current))))) (require-match) (def) (prompt . "Switch to buffer: ") t) (input) (let* ((buffers (mapcar #'buffer-name (buffer-list))) (candidates (if predicate (cl-delete-if-not predicate buffers) buffers))) (if (string-prefix-p " " input) (progn (setq input (substring input 1)) (setq candidates (cl-delete-if-not #'... candidates))) (setq candidates (cl-delete-if #'(lambda ... ...) candidates))) (list (cons 'candidates candidates) (cons 'input input))))("")
  funcall((closure ((predicate closure ((other-name . "*Ibuffer*") (other-buffer . #<buffer *Ibuffer*>) (current-buffer . #<buffer init.el>) (pr vc . "~/.emacs.d/") t) (buffer) (and (cdr buffer) (equal pr (save-current-buffer (set-buffer ...) (project-current))))) (require-match) (def) (prompt . "Switch to buffer: ") t) (input) (let* ((buffers (mapcar #'buffer-name (buffer-list))) (candidates (if predicate (cl-delete-if-not predicate buffers) buffers))) (if (string-prefix-p " " input) (progn (setq input (substring input 1)) (setq candidates (cl-delete-if-not #'... candidates))) (setq candidates (cl-delete-if #'(lambda ... ...) candidates))) (list (cons 'candidates candidates) (cons 'input input)))) "")
  (let ((result (funcall selectrum--preprocessed-candidates input))) (if (stringp (car result)) result (setq input (or (alist-get 'input result) input)) (setq selectrum--visual-input input) (alist-get 'candidates result)))
  (funcall selectrum-preprocess-candidates-function (let ((result (funcall selectrum--preprocessed-candidates input))) (if (stringp (car result)) result (setq input (or (alist-get 'input result) input)) (setq selectrum--visual-input input) (alist-get 'candidates result))))
  (if (functionp selectrum--preprocessed-candidates) (funcall selectrum-preprocess-candidates-function (let ((result (funcall selectrum--preprocessed-candidates input))) (if (stringp (car result)) result (setq input (or (alist-get 'input result) input)) (setq selectrum--visual-input input) (alist-get 'candidates result)))) selectrum--preprocessed-candidates)
  (let ((cands (if (functionp selectrum--preprocessed-candidates) (funcall selectrum-preprocess-candidates-function (let ((result ...)) (if (stringp ...) result (setq input ...) (setq selectrum--visual-input input) (alist-get ... result)))) selectrum--preprocessed-candidates))) (setq selectrum--total-num-candidates (length cands)) (setq selectrum--refined-candidates (funcall selectrum-refine-candidates-function input cands)))
  (if (equal input selectrum--previous-input-string) nil (if (and (not selectrum--preprocessed-candidates) minibuffer-completion-table) (progn (setq selectrum--preprocessed-candidates (funcall selectrum-preprocess-candidates-function (selectrum--get-candidates-from-table))))) (setq selectrum--previous-input-string input) (setq selectrum--visual-input nil) (let ((cands (if (functionp selectrum--preprocessed-candidates) (funcall selectrum-preprocess-candidates-function (let (...) (if ... result ... ... ...))) selectrum--preprocessed-candidates))) (setq selectrum--total-num-candidates (length cands)) (setq selectrum--refined-candidates (funcall selectrum-refine-candidates-function input cands))) (if selectrum--move-default-candidate-p (progn (setq selectrum--refined-candidates (selectrum--move-to-front-destructive selectrum--default-candidate selectrum--refined-candidates)))) (setq selectrum--refined-candidates (selectrum--move-to-front-destructive input selectrum--refined-candidates)) (setq selectrum--refined-candidates (delete "" selectrum--refined-candidates)) (if selectrum--repeat (progn (setq selectrum--current-candidate-index (and (> (length selectrum--refined-candidates) 0) (min (or selectrum--current-candidate-index 0) (1- (length selectrum--refined-candidates))))) (setq selectrum--repeat nil)) (setq selectrum--current-candidate-index (cond ((null selectrum--refined-candidates) nil) ((and selectrum--default-candidate (string-empty-p (minibuffer-contents)) (not (member selectrum--default-candidate selectrum--refined-candidates))) -1) ((and selectrum--init-p minibuffer-completing-file-name (eq minibuffer-completion-predicate 'file-directory-p) (equal (minibuffer-contents) selectrum--default-candidate)) -1) (selectrum--move-default-candidate-p 0) (t (or (cl-position selectrum--default-candidate selectrum--refined-candidates :key #'selectrum--get-full :test #'equal) 0))))))
  (let ((inhibit-read-only t) (buffer-undo-list t) (input (buffer-substring selectrum--start-of-input-marker selectrum--end-of-input-marker)) (bound (marker-position selectrum--end-of-input-marker)) (keep-mark-active (not deactivate-mark))) (if (equal input selectrum--previous-input-string) nil (if (and (not selectrum--preprocessed-candidates) minibuffer-completion-table) (progn (setq selectrum--preprocessed-candidates (funcall selectrum-preprocess-candidates-function (selectrum--get-candidates-from-table))))) (setq selectrum--previous-input-string input) (setq selectrum--visual-input nil) (let ((cands (if (functionp selectrum--preprocessed-candidates) (funcall selectrum-preprocess-candidates-function (let ... ...)) selectrum--preprocessed-candidates))) (setq selectrum--total-num-candidates (length cands)) (setq selectrum--refined-candidates (funcall selectrum-refine-candidates-function input cands))) (if selectrum--move-default-candidate-p (progn (setq selectrum--refined-candidates (selectrum--move-to-front-destructive selectrum--default-candidate selectrum--refined-candidates)))) (setq selectrum--refined-candidates (selectrum--move-to-front-destructive input selectrum--refined-candidates)) (setq selectrum--refined-candidates (delete "" selectrum--refined-candidates)) (if selectrum--repeat (progn (setq selectrum--current-candidate-index (and (> (length selectrum--refined-candidates) 0) (min (or selectrum--current-candidate-index 0) (1- ...)))) (setq selectrum--repeat nil)) (setq selectrum--current-candidate-index (cond ((null selectrum--refined-candidates) nil) ((and selectrum--default-candidate (string-empty-p ...) (not ...)) -1) ((and selectrum--init-p minibuffer-completing-file-name (eq minibuffer-completion-predicate ...) (equal ... selectrum--default-candidate)) -1) (selectrum--move-default-candidate-p 0) (t (or (cl-position selectrum--default-candidate selectrum--refined-candidates :key ... :test ...) 0)))))) (overlay-put selectrum--count-overlay 'before-string (selectrum--count-info)) (overlay-put selectrum--count-overlay 'priority 1) (while selectrum--right-margin-overlays (delete-overlay (car-safe (prog1 selectrum--right-margin-overlays (setq selectrum--right-margin-overlays (cdr selectrum--right-margin-overlays)))))) (setq input (or selectrum--visual-input input)) (let* ((first-index-displayed (if selectrum--current-candidate-index (selectrum--clamp (1+ (- selectrum--current-candidate-index ...)) 0 (max (- ... selectrum-num-candidates-displayed) 0)) 0)) (displayed-candidates (seq-take (nthcdr first-index-displayed selectrum--refined-candidates) selectrum-num-candidates-displayed)) (highlighted-index (and selectrum--current-candidate-index (- selectrum--current-candidate-index first-index-displayed)))) (setq displayed-candidates (seq-take displayed-candidates selectrum-num-candidates-displayed)) (let ((n (1+ (if selectrum-fix-minibuffer-height selectrum-num-candidates-displayed (max ... ...))))) (progn (enlarge-window (- n (window-height))) n)) (let ((text (selectrum--candidates-display-string displayed-candidates input highlighted-index first-index-displayed)) (default nil)) (if (or (and highlighted-index (< highlighted-index 0)) (and (not selectrum--match-required-p) (not displayed-candidates)) (and selectrum--default-candidate (not minibuffer-completing-file-name) (not (member selectrum--default-candidate selectrum--refined-candidates)))) (if (= (minibuffer-prompt-end) bound) (setq default (format " %s %s%s" (propertize "[default value:" ... ...) (propertize ... ... ...) (propertize "]" ... ...))) (if (or (and highlighted-index ...) selectrum--match-required-p) nil (add-text-properties (minibuffer-prompt-end) bound '...))) (remove-text-properties (minibuffer-prompt-end) bound '(face selectrum-current-candidate))) (move-overlay selectrum--candidates-overlay (point-max) (point-max) (current-buffer)) (setq text (concat (or default " ") text)) (put-text-property 0 1 'cursor t text) (overlay-put selectrum--candidates-overlay 'after-string text))) (setq selectrum--end-of-input-marker (set-marker (make-marker) bound)) (set-marker-insertion-type selectrum--end-of-input-marker t) (selectrum--fix-set-minibuffer-message) (if keep-mark-active (progn (setq deactivate-mark nil))) (set (make-local-variable 'selectrum--init-p) nil))
  (closure (t) nil "Update minibuffer in response to user input." (goto-char (max (point) selectrum--start-of-input-marker)) (goto-char (min (point) selectrum--end-of-input-marker)) (set (make-local-variable 'truncate-lines) t) (let ((inhibit-read-only t) (buffer-undo-list t) (input (buffer-substring selectrum--start-of-input-marker selectrum--end-of-input-marker)) (bound (marker-position selectrum--end-of-input-marker)) (keep-mark-active (not deactivate-mark))) (if (equal input selectrum--previous-input-string) nil (if (and (not selectrum--preprocessed-candidates) minibuffer-completion-table) (progn (setq selectrum--preprocessed-candidates (funcall selectrum-preprocess-candidates-function (selectrum--get-candidates-from-table))))) (setq selectrum--previous-input-string input) (setq selectrum--visual-input nil) (let ((cands (if (functionp selectrum--preprocessed-candidates) (funcall selectrum-preprocess-candidates-function ...) selectrum--preprocessed-candidates))) (setq selectrum--total-num-candidates (length cands)) (setq selectrum--refined-candidates (funcall selectrum-refine-candidates-function input cands))) (if selectrum--move-default-candidate-p (progn (setq selectrum--refined-candidates (selectrum--move-to-front-destructive selectrum--default-candidate selectrum--refined-candidates)))) (setq selectrum--refined-candidates (selectrum--move-to-front-destructive input selectrum--refined-candidates)) (setq selectrum--refined-candidates (delete "" selectrum--refined-candidates)) (if selectrum--repeat (progn (setq selectrum--current-candidate-index (and (> ... 0) (min ... ...))) (setq selectrum--repeat nil)) (setq selectrum--current-candidate-index (cond ((null selectrum--refined-candidates) nil) ((and selectrum--default-candidate ... ...) -1) ((and selectrum--init-p minibuffer-completing-file-name ... ...) -1) (selectrum--move-default-candidate-p 0) (t (or ... 0)))))) (overlay-put selectrum--count-overlay 'before-string (selectrum--count-info)) (overlay-put selectrum--count-overlay 'priority 1) (while selectrum--right-margin-overlays (delete-overlay (car-safe (prog1 selectrum--right-margin-overlays (setq selectrum--right-margin-overlays (cdr selectrum--right-margin-overlays)))))) (setq input (or selectrum--visual-input input)) (let* ((first-index-displayed (if selectrum--current-candidate-index (selectrum--clamp (1+ ...) 0 (max ... 0)) 0)) (displayed-candidates (seq-take (nthcdr first-index-displayed selectrum--refined-candidates) selectrum-num-candidates-displayed)) (highlighted-index (and selectrum--current-candidate-index (- selectrum--current-candidate-index first-index-displayed)))) (setq displayed-candidates (seq-take displayed-candidates selectrum-num-candidates-displayed)) (let ((n (1+ (if selectrum-fix-minibuffer-height selectrum-num-candidates-displayed ...)))) (progn (enlarge-window (- n (window-height))) n)) (let ((text (selectrum--candidates-display-string displayed-candidates input highlighted-index first-index-displayed)) (default nil)) (if (or (and highlighted-index (< highlighted-index 0)) (and (not selectrum--match-required-p) (not displayed-candidates)) (and selectrum--default-candidate (not minibuffer-completing-file-name) (not ...))) (if (= (minibuffer-prompt-end) bound) (setq default (format " %s %s%s" ... ... ...)) (if (or ... selectrum--match-required-p) nil (add-text-properties ... bound ...))) (remove-text-properties (minibuffer-prompt-end) bound '(face selectrum-current-candidate))) (move-overlay selectrum--candidates-overlay (point-max) (point-max) (current-buffer)) (setq text (concat (or default " ") text)) (put-text-property 0 1 'cursor t text) (overlay-put selectrum--candidates-overlay 'after-string text))) (setq selectrum--end-of-input-marker (set-marker (make-marker) bound)) (set-marker-insertion-type selectrum--end-of-input-marker t) (selectrum--fix-set-minibuffer-message) (if keep-mark-active (progn (setq deactivate-mark nil))) (set (make-local-variable 'selectrum--init-p) nil)))()
  apply((closure (t) nil "Update minibuffer in response to user input." (goto-char (max (point) selectrum--start-of-input-marker)) (goto-char (min (point) selectrum--end-of-input-marker)) (set (make-local-variable 'truncate-lines) t) (let ((inhibit-read-only t) (buffer-undo-list t) (input (buffer-substring selectrum--start-of-input-marker selectrum--end-of-input-marker)) (bound (marker-position selectrum--end-of-input-marker)) (keep-mark-active (not deactivate-mark))) (if (equal input selectrum--previous-input-string) nil (if (and (not selectrum--preprocessed-candidates) minibuffer-completion-table) (progn (setq selectrum--preprocessed-candidates (funcall selectrum-preprocess-candidates-function ...)))) (setq selectrum--previous-input-string input) (setq selectrum--visual-input nil) (let ((cands (if ... ... selectrum--preprocessed-candidates))) (setq selectrum--total-num-candidates (length cands)) (setq selectrum--refined-candidates (funcall selectrum-refine-candidates-function input cands))) (if selectrum--move-default-candidate-p (progn (setq selectrum--refined-candidates (selectrum--move-to-front-destructive selectrum--default-candidate selectrum--refined-candidates)))) (setq selectrum--refined-candidates (selectrum--move-to-front-destructive input selectrum--refined-candidates)) (setq selectrum--refined-candidates (delete "" selectrum--refined-candidates)) (if selectrum--repeat (progn (setq selectrum--current-candidate-index (and ... ...)) (setq selectrum--repeat nil)) (setq selectrum--current-candidate-index (cond (... nil) (... -1) (... -1) (selectrum--move-default-candidate-p 0) (t ...))))) (overlay-put selectrum--count-overlay 'before-string (selectrum--count-info)) (overlay-put selectrum--count-overlay 'priority 1) (while selectrum--right-margin-overlays (delete-overlay (car-safe (prog1 selectrum--right-margin-overlays (setq selectrum--right-margin-overlays ...))))) (setq input (or selectrum--visual-input input)) (let* ((first-index-displayed (if selectrum--current-candidate-index (selectrum--clamp ... 0 ...) 0)) (displayed-candidates (seq-take (nthcdr first-index-displayed selectrum--refined-candidates) selectrum-num-candidates-displayed)) (highlighted-index (and selectrum--current-candidate-index (- selectrum--current-candidate-index first-index-displayed)))) (setq displayed-candidates (seq-take displayed-candidates selectrum-num-candidates-displayed)) (let ((n (1+ ...))) (progn (enlarge-window (- n ...)) n)) (let ((text (selectrum--candidates-display-string displayed-candidates input highlighted-index first-index-displayed)) (default nil)) (if (or (and highlighted-index ...) (and ... ...) (and selectrum--default-candidate ... ...)) (if (= ... bound) (setq default ...) (if ... nil ...)) (remove-text-properties (minibuffer-prompt-end) bound '...)) (move-overlay selectrum--candidates-overlay (point-max) (point-max) (current-buffer)) (setq text (concat (or default " ") text)) (put-text-property 0 1 'cursor t text) (overlay-put selectrum--candidates-overlay 'after-string text))) (setq selectrum--end-of-input-marker (set-marker (make-marker) bound)) (set-marker-insertion-type selectrum--end-of-input-marker t) (selectrum--fix-set-minibuffer-message) (if keep-mark-active (progn (setq deactivate-mark nil))) (set (make-local-variable 'selectrum--init-p) nil))) nil)
  force-debug((closure (t) nil "Update minibuffer in response to user input." (goto-char (max (point) selectrum--start-of-input-marker)) (goto-char (min (point) selectrum--end-of-input-marker)) (set (make-local-variable 'truncate-lines) t) (let ((inhibit-read-only t) (buffer-undo-list t) (input (buffer-substring selectrum--start-of-input-marker selectrum--end-of-input-marker)) (bound (marker-position selectrum--end-of-input-marker)) (keep-mark-active (not deactivate-mark))) (if (equal input selectrum--previous-input-string) nil (if (and (not selectrum--preprocessed-candidates) minibuffer-completion-table) (progn (setq selectrum--preprocessed-candidates (funcall selectrum-preprocess-candidates-function ...)))) (setq selectrum--previous-input-string input) (setq selectrum--visual-input nil) (let ((cands (if ... ... selectrum--preprocessed-candidates))) (setq selectrum--total-num-candidates (length cands)) (setq selectrum--refined-candidates (funcall selectrum-refine-candidates-function input cands))) (if selectrum--move-default-candidate-p (progn (setq selectrum--refined-candidates (selectrum--move-to-front-destructive selectrum--default-candidate selectrum--refined-candidates)))) (setq selectrum--refined-candidates (selectrum--move-to-front-destructive input selectrum--refined-candidates)) (setq selectrum--refined-candidates (delete "" selectrum--refined-candidates)) (if selectrum--repeat (progn (setq selectrum--current-candidate-index (and ... ...)) (setq selectrum--repeat nil)) (setq selectrum--current-candidate-index (cond (... nil) (... -1) (... -1) (selectrum--move-default-candidate-p 0) (t ...))))) (overlay-put selectrum--count-overlay 'before-string (selectrum--count-info)) (overlay-put selectrum--count-overlay 'priority 1) (while selectrum--right-margin-overlays (delete-overlay (car-safe (prog1 selectrum--right-margin-overlays (setq selectrum--right-margin-overlays ...))))) (setq input (or selectrum--visual-input input)) (let* ((first-index-displayed (if selectrum--current-candidate-index (selectrum--clamp ... 0 ...) 0)) (displayed-candidates (seq-take (nthcdr first-index-displayed selectrum--refined-candidates) selectrum-num-candidates-displayed)) (highlighted-index (and selectrum--current-candidate-index (- selectrum--current-candidate-index first-index-displayed)))) (setq displayed-candidates (seq-take displayed-candidates selectrum-num-candidates-displayed)) (let ((n (1+ ...))) (progn (enlarge-window (- n ...)) n)) (let ((text (selectrum--candidates-display-string displayed-candidates input highlighted-index first-index-displayed)) (default nil)) (if (or (and highlighted-index ...) (and ... ...) (and selectrum--default-candidate ... ...)) (if (= ... bound) (setq default ...) (if ... nil ...)) (remove-text-properties (minibuffer-prompt-end) bound '...)) (move-overlay selectrum--candidates-overlay (point-max) (point-max) (current-buffer)) (setq text (concat (or default " ") text)) (put-text-property 0 1 'cursor t text) (overlay-put selectrum--candidates-overlay 'after-string text))) (setq selectrum--end-of-input-marker (set-marker (make-marker) bound)) (set-marker-insertion-type selectrum--end-of-input-marker t) (selectrum--fix-set-minibuffer-message) (if keep-mark-active (progn (setq deactivate-mark nil))) (set (make-local-variable 'selectrum--init-p) nil))))
  apply(force-debug (closure (t) nil "Update minibuffer in response to user input." (goto-char (max (point) selectrum--start-of-input-marker)) (goto-char (min (point) selectrum--end-of-input-marker)) (set (make-local-variable 'truncate-lines) t) (let ((inhibit-read-only t) (buffer-undo-list t) (input (buffer-substring selectrum--start-of-input-marker selectrum--end-of-input-marker)) (bound (marker-position selectrum--end-of-input-marker)) (keep-mark-active (not deactivate-mark))) (if (equal input selectrum--previous-input-string) nil (if (and (not selectrum--preprocessed-candidates) minibuffer-completion-table) (progn (setq selectrum--preprocessed-candidates (funcall selectrum-preprocess-candidates-function ...)))) (setq selectrum--previous-input-string input) (setq selectrum--visual-input nil) (let ((cands (if ... ... selectrum--preprocessed-candidates))) (setq selectrum--total-num-candidates (length cands)) (setq selectrum--refined-candidates (funcall selectrum-refine-candidates-function input cands))) (if selectrum--move-default-candidate-p (progn (setq selectrum--refined-candidates (selectrum--move-to-front-destructive selectrum--default-candidate selectrum--refined-candidates)))) (setq selectrum--refined-candidates (selectrum--move-to-front-destructive input selectrum--refined-candidates)) (setq selectrum--refined-candidates (delete "" selectrum--refined-candidates)) (if selectrum--repeat (progn (setq selectrum--current-candidate-index (and ... ...)) (setq selectrum--repeat nil)) (setq selectrum--current-candidate-index (cond (... nil) (... -1) (... -1) (selectrum--move-default-candidate-p 0) (t ...))))) (overlay-put selectrum--count-overlay 'before-string (selectrum--count-info)) (overlay-put selectrum--count-overlay 'priority 1) (while selectrum--right-margin-overlays (delete-overlay (car-safe (prog1 selectrum--right-margin-overlays (setq selectrum--right-margin-overlays ...))))) (setq input (or selectrum--visual-input input)) (let* ((first-index-displayed (if selectrum--current-candidate-index (selectrum--clamp ... 0 ...) 0)) (displayed-candidates (seq-take (nthcdr first-index-displayed selectrum--refined-candidates) selectrum-num-candidates-displayed)) (highlighted-index (and selectrum--current-candidate-index (- selectrum--current-candidate-index first-index-displayed)))) (setq displayed-candidates (seq-take displayed-candidates selectrum-num-candidates-displayed)) (let ((n (1+ ...))) (progn (enlarge-window (- n ...)) n)) (let ((text (selectrum--candidates-display-string displayed-candidates input highlighted-index first-index-displayed)) (default nil)) (if (or (and highlighted-index ...) (and ... ...) (and selectrum--default-candidate ... ...)) (if (= ... bound) (setq default ...) (if ... nil ...)) (remove-text-properties (minibuffer-prompt-end) bound '...)) (move-overlay selectrum--candidates-overlay (point-max) (point-max) (current-buffer)) (setq text (concat (or default " ") text)) (put-text-property 0 1 'cursor t text) (overlay-put selectrum--candidates-overlay 'after-string text))) (setq selectrum--end-of-input-marker (set-marker (make-marker) bound)) (set-marker-insertion-type selectrum--end-of-input-marker t) (selectrum--fix-set-minibuffer-message) (if keep-mark-active (progn (setq deactivate-mark nil))) (set (make-local-variable 'selectrum--init-p) nil))) nil)
  selectrum--minibuffer-post-command-hook()
  read-from-minibuffer("Switch to buffer: " nil (keymap (9 . selectrum-insert-current-candidate) (10 . selectrum-submit-exact-input) (remap keymap (evil-previous-line . selectrum-previous-candidate) (evil-next-line . selectrum-next-candidate) (previous-matching-history-element . selectrum-select-from-history) (kill-ring-save . selectrum-kill-ring-save) (end-of-buffer . selectrum-goto-end) (beginning-of-buffer . selectrum-goto-beginning) (minibuffer-beginning-of-buffer . selectrum-goto-beginning) (scroll-up-command . selectrum-next-page) (scroll-down-command . selectrum-previous-page) (exit-minibuffer . selectrum-select-current-candidate) (next-line-or-history-element . selectrum-next-candidate) (previous-line-or-history-element . selectrum-previous-candidate) (next-line . selectrum-next-candidate) (previous-line . selectrum-previous-candidate) (minibuffer-keyboard-quit . abort-recursive-edit) (keyboard-quit . abort-recursive-edit)) (C-backspace . my--backward-zap-up-to-separator) (18 . selectrum-select-from-history) (67108913 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c6f8680>)) (67108914 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c6e9680>)) (67108915 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c68a680>)) (67108916 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c69b680>)) (67108917 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9ca04680>)) (67108918 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9ca15680>)) (67108919 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c616680>)) (67108920 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c607680>)) (27 keymap (67108991 . backward-kill-sexp) (C-backspace . my--backward-zap-up-to-separator) (115 . selectrum-select-from-history) (48 . selectrum-submit-exact-input) (49 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c673a80>)) (50 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c6f4a80>)) (51 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c6e5a80>)) (52 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c686a80>)) (53 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c697a80>)) (54 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9ca08a80>)) (55 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9ca19a80>)) (56 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c61aa80>)) (57 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c60ba80>))) (67108921 . #f(compiled-function () (interactive nil) #<bytecode 0x1f401b9c620680>)) keymap (18 . helm-minibuffer-history) (remap keymap (previous-matching-history-element . selectrum-select-from-history)) (15 . embark-act-noexit) (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (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 "\15" :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 (15 . embark-act-noexit) (111 . embark-act) (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil buffer-name-history)
  (let* ((minibuffer-allow-text-properties t) (resize-mini-windows 'grow-only) (max-mini-window-height (1+ selectrum-num-candidates-displayed)) (prompt (selectrum--remove-default-from-prompt prompt)) (completing-read-function #'selectrum-completing-read) (icomplete-mode nil) (selectrum-active-p t)) (read-from-minibuffer prompt nil keymap nil (or history 'minibuffer-history)))
  (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((minibuffer-allow-text-properties t) (resize-mini-windows 'grow-only) (max-mini-window-height (1+ selectrum-num-candidates-displayed)) (prompt (selectrum--remove-default-from-prompt prompt)) (completing-read-function #'selectrum-completing-read) (icomplete-mode nil) (selectrum-active-p t)) (read-from-minibuffer prompt nil keymap nil (or history 'minibuffer-history))))
  (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((minibuffer-allow-text-properties t) (resize-mini-windows 'grow-only) (max-mini-window-height (1+ selectrum-num-candidates-displayed)) (prompt (selectrum--remove-default-from-prompt prompt)) (completing-read-function #'selectrum-completing-read) (icomplete-mode nil) (selectrum-active-p t)) (read-from-minibuffer prompt nil keymap nil (or history 'minibuffer-history)))) (remove-hook 'minibuffer-setup-hook setup-hook))
  (let ((fun #'(lambda nil (selectrum--minibuffer-setup-hook candidates :default-candidate default-candidate :initial-input initial-input))) setup-hook) (setq setup-hook #'(lambda nil (remove-hook 'minibuffer-setup-hook setup-hook) (funcall fun))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((minibuffer-allow-text-properties t) (resize-mini-windows 'grow-only) (max-mini-window-height (1+ selectrum-num-candidates-displayed)) (prompt (selectrum--remove-default-from-prompt prompt)) (completing-read-function #'selectrum-completing-read) (icomplete-mode nil) (selectrum-active-p t)) (read-from-minibuffer prompt nil keymap nil (or history 'minibuffer-history)))) (remove-hook 'minibuffer-setup-hook setup-hook)))
  (let ((keymap (make-sparse-keymap))) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'(lambda (key cmd) (if (stringp key) (progn (setq key (kbd key)))) (define-key keymap key cmd)) selectrum-minibuffer-bindings) (let ((fun #'(lambda nil (selectrum--minibuffer-setup-hook candidates :default-candidate default-candidate :initial-input initial-input))) setup-hook) (setq setup-hook #'(lambda nil (remove-hook 'minibuffer-setup-hook setup-hook) (funcall fun))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((minibuffer-allow-text-properties t) (resize-mini-windows 'grow-only) (max-mini-window-height (1+ selectrum-num-candidates-displayed)) (prompt (selectrum--remove-default-from-prompt prompt)) (completing-read-function #'selectrum-completing-read) (icomplete-mode nil) (selectrum-active-p t)) (read-from-minibuffer prompt nil keymap nil (or history 'minibuffer-history)))) (remove-hook 'minibuffer-setup-hook setup-hook))))
  (if selectrum-active-p (let ((selectrum--current-candidate-index selectrum--current-candidate-index) (selectrum--previous-input-string selectrum--previous-input-string) (selectrum--last-command selectrum--last-command) (selectrum--last-prefix-arg selectrum--last-prefix-arg)) (setq selectrum--read-args (cons prompt (cons candidates args))) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let ((keymap (make-sparse-keymap))) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'(lambda (key cmd) (if (stringp key) (progn ...)) (define-key keymap key cmd)) selectrum-minibuffer-bindings) (let ((fun #'(lambda nil ...)) setup-hook) (setq setup-hook #'(lambda nil (remove-hook ... setup-hook) (funcall fun))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* (... ... ... ... ... ... ...) (read-from-minibuffer prompt nil keymap nil ...))) (remove-hook 'minibuffer-setup-hook setup-hook))))) (setq selectrum--read-args (cons prompt (cons candidates args))) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let ((keymap (make-sparse-keymap))) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'(lambda (key cmd) (if (stringp key) (progn (setq key ...))) (define-key keymap key cmd)) selectrum-minibuffer-bindings) (let ((fun #'(lambda nil (selectrum--minibuffer-setup-hook candidates :default-candidate default-candidate :initial-input initial-input))) setup-hook) (setq setup-hook #'(lambda nil (remove-hook 'minibuffer-setup-hook setup-hook) (funcall fun))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* ((minibuffer-allow-text-properties t) (resize-mini-windows ...) (max-mini-window-height ...) (prompt ...) (completing-read-function ...) (icomplete-mode nil) (selectrum-active-p t)) (read-from-minibuffer prompt nil keymap nil (or history ...)))) (remove-hook 'minibuffer-setup-hook setup-hook)))))
  (let ((selectrum--start-of-input-marker selectrum--start-of-input-marker) (selectrum--end-of-input-marker selectrum--end-of-input-marker) (selectrum--preprocessed-candidates selectrum--preprocessed-candidates) (selectrum--refined-candidates selectrum--refined-candidates) (selectrum--match-required-p selectrum--match-required-p) (selectrum--move-default-candidate-p selectrum--move-default-candidate-p) (selectrum--default-candidate selectrum--default-candidate) (selectrum--visual-input selectrum--visual-input) (selectrum--read-args selectrum--read-args) (selectrum--count-overlay selectrum--count-overlay) (selectrum--right-margin-overlays selectrum--right-margin-overlays) (selectrum--repeat selectrum--repeat) (selectrum-active-p selectrum-active-p)) (if selectrum-active-p (let ((selectrum--current-candidate-index selectrum--current-candidate-index) (selectrum--previous-input-string selectrum--previous-input-string) (selectrum--last-command selectrum--last-command) (selectrum--last-prefix-arg selectrum--last-prefix-arg)) (setq selectrum--read-args (cons prompt (cons candidates args))) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let ((keymap (make-sparse-keymap))) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'(lambda (key cmd) (if ... ...) (define-key keymap key cmd)) selectrum-minibuffer-bindings) (let ((fun #'...) setup-hook) (setq setup-hook #'(lambda nil ... ...)) (unwind-protect (progn (add-hook ... setup-hook) (let* ... ...)) (remove-hook 'minibuffer-setup-hook setup-hook))))) (setq selectrum--read-args (cons prompt (cons candidates args))) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let ((keymap (make-sparse-keymap))) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'(lambda (key cmd) (if (stringp key) (progn ...)) (define-key keymap key cmd)) selectrum-minibuffer-bindings) (let ((fun #'(lambda nil ...)) setup-hook) (setq setup-hook #'(lambda nil (remove-hook ... setup-hook) (funcall fun))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let* (... ... ... ... ... ... ...) (read-from-minibuffer prompt nil keymap nil ...))) (remove-hook 'minibuffer-setup-hook setup-hook))))))
  (progn (if may-modify-candidates nil (setq candidates (copy-sequence candidates))) (let ((selectrum--start-of-input-marker selectrum--start-of-input-marker) (selectrum--end-of-input-marker selectrum--end-of-input-marker) (selectrum--preprocessed-candidates selectrum--preprocessed-candidates) (selectrum--refined-candidates selectrum--refined-candidates) (selectrum--match-required-p selectrum--match-required-p) (selectrum--move-default-candidate-p selectrum--move-default-candidate-p) (selectrum--default-candidate selectrum--default-candidate) (selectrum--visual-input selectrum--visual-input) (selectrum--read-args selectrum--read-args) (selectrum--count-overlay selectrum--count-overlay) (selectrum--right-margin-overlays selectrum--right-margin-overlays) (selectrum--repeat selectrum--repeat) (selectrum-active-p selectrum-active-p)) (if selectrum-active-p (let ((selectrum--current-candidate-index selectrum--current-candidate-index) (selectrum--previous-input-string selectrum--previous-input-string) (selectrum--last-command selectrum--last-command) (selectrum--last-prefix-arg selectrum--last-prefix-arg)) (setq selectrum--read-args (cons prompt (cons candidates args))) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let ((keymap (make-sparse-keymap))) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'(lambda ... ... ...) selectrum-minibuffer-bindings) (let ((fun ...) setup-hook) (setq setup-hook #'...) (unwind-protect (progn ... ...) (remove-hook ... setup-hook))))) (setq selectrum--read-args (cons prompt (cons candidates args))) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let ((keymap (make-sparse-keymap))) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'(lambda (key cmd) (if ... ...) (define-key keymap key cmd)) selectrum-minibuffer-bindings) (let ((fun #'...) setup-hook) (setq setup-hook #'(lambda nil ... ...)) (unwind-protect (progn (add-hook ... setup-hook) (let* ... ...)) (remove-hook 'minibuffer-setup-hook setup-hook)))))))
  (progn (let ((--cl-keys-- args)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:default-candidate :initial-input :require-match :history :no-move-default-candidate :may-modify-candidates :minibuffer-completion-table :minibuffer-completion-predicate :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ... args))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:default-candidate..." (car --cl-keys--)))))) (progn (if may-modify-candidates nil (setq candidates (copy-sequence candidates))) (let ((selectrum--start-of-input-marker selectrum--start-of-input-marker) (selectrum--end-of-input-marker selectrum--end-of-input-marker) (selectrum--preprocessed-candidates selectrum--preprocessed-candidates) (selectrum--refined-candidates selectrum--refined-candidates) (selectrum--match-required-p selectrum--match-required-p) (selectrum--move-default-candidate-p selectrum--move-default-candidate-p) (selectrum--default-candidate selectrum--default-candidate) (selectrum--visual-input selectrum--visual-input) (selectrum--read-args selectrum--read-args) (selectrum--count-overlay selectrum--count-overlay) (selectrum--right-margin-overlays selectrum--right-margin-overlays) (selectrum--repeat selectrum--repeat) (selectrum-active-p selectrum-active-p)) (if selectrum-active-p (let ((selectrum--current-candidate-index selectrum--current-candidate-index) (selectrum--previous-input-string selectrum--previous-input-string) (selectrum--last-command selectrum--last-command) (selectrum--last-prefix-arg selectrum--last-prefix-arg)) (setq selectrum--read-args (cons prompt (cons candidates args))) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let ((keymap ...)) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'... selectrum-minibuffer-bindings) (let (... setup-hook) (setq setup-hook ...) (unwind-protect ... ...)))) (setq selectrum--read-args (cons prompt (cons candidates args))) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let ((keymap (make-sparse-keymap))) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'(lambda ... ... ...) selectrum-minibuffer-bindings) (let ((fun ...) setup-hook) (setq setup-hook #'...) (unwind-protect (progn ... ...) (remove-hook ... setup-hook))))))))
  (let* ((default-candidate (car (cdr (plist-member args ':default-candidate)))) (initial-input (car (cdr (plist-member args ':initial-input)))) (require-match (car (cdr (plist-member args ':require-match)))) (history (car (cdr (plist-member args ':history)))) (no-move-default-candidate (car (cdr (plist-member args ':no-move-default-candidate)))) (may-modify-candidates (car (cdr (plist-member args ':may-modify-candidates)))) (minibuffer-completion-table (car (cdr (plist-member args ':minibuffer-completion-table)))) (minibuffer-completion-predicate (car (cdr (plist-member args ':minibuffer-completion-predicate))))) (progn (let ((--cl-keys-- args)) (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 (:default-candidate..." (car --cl-keys--)))))) (progn (if may-modify-candidates nil (setq candidates (copy-sequence candidates))) (let ((selectrum--start-of-input-marker selectrum--start-of-input-marker) (selectrum--end-of-input-marker selectrum--end-of-input-marker) (selectrum--preprocessed-candidates selectrum--preprocessed-candidates) (selectrum--refined-candidates selectrum--refined-candidates) (selectrum--match-required-p selectrum--match-required-p) (selectrum--move-default-candidate-p selectrum--move-default-candidate-p) (selectrum--default-candidate selectrum--default-candidate) (selectrum--visual-input selectrum--visual-input) (selectrum--read-args selectrum--read-args) (selectrum--count-overlay selectrum--count-overlay) (selectrum--right-margin-overlays selectrum--right-margin-overlays) (selectrum--repeat selectrum--repeat) (selectrum-active-p selectrum-active-p)) (if selectrum-active-p (let ((selectrum--current-candidate-index selectrum--current-candidate-index) (selectrum--previous-input-string selectrum--previous-input-string) (selectrum--last-command selectrum--last-command) (selectrum--last-prefix-arg selectrum--last-prefix-arg)) (setq selectrum--read-args (cons prompt ...)) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let (...) (set-keymap-parent keymap minibuffer-local-map) (map-apply ... selectrum-minibuffer-bindings) (let ... ... ...))) (setq selectrum--read-args (cons prompt (cons candidates args))) (if selectrum--repeat nil (setq selectrum--last-command this-command) (setq selectrum--last-prefix-arg current-prefix-arg)) (setq selectrum--match-required-p require-match) (setq selectrum--move-default-candidate-p (not no-move-default-candidate)) (let ((keymap ...)) (set-keymap-parent keymap minibuffer-local-map) (map-apply #'... selectrum-minibuffer-bindings) (let (... setup-hook) (setq setup-hook ...) (unwind-protect ... ...))))))))
  selectrum-read("Switch to buffer: " (closure ((predicate closure ((other-name . "*Ibuffer*") (other-buffer . #<buffer *Ibuffer*>) (current-buffer . #<buffer init.el>) (pr vc . "~/.emacs.d/") t) (buffer) (and (cdr buffer) (equal pr (save-current-buffer (set-buffer ...) (project-current))))) (require-match) (def) (prompt . "Switch to buffer: ") t) (input) (let* ((buffers (mapcar #'buffer-name (buffer-list))) (candidates (if predicate (cl-delete-if-not predicate buffers) buffers))) (if (string-prefix-p " " input) (progn (setq input (substring input 1)) (setq candidates (cl-delete-if-not #'... candidates))) (setq candidates (cl-delete-if #'(lambda ... ...) candidates))) (list (cons 'candidates candidates) (cons 'input input)))) :default-candidate nil :require-match nil :history buffer-name-history :no-move-default-candidate t :may-modify-candidates t :minibuffer-completion-table internal-complete-buffer :minibuffer-completion-predicate (closure ((other-name . "*Ibuffer*") (other-buffer . #<buffer *Ibuffer*>) (current-buffer . #<buffer init.el>) (pr vc . "~/.emacs.d/") t) (buffer) (and (cdr buffer) (equal pr (save-current-buffer (set-buffer (cdr buffer)) (project-current))))))
  (substring-no-properties (selectrum-read prompt candidates :default-candidate def :require-match (eq require-match t) :history 'buffer-name-history :no-move-default-candidate t :may-modify-candidates t :minibuffer-completion-table #'internal-complete-buffer :minibuffer-completion-predicate predicate))
  (let ((selectrum-should-sort-p nil) (candidates #'(lambda (input) (let* ((buffers ...) (candidates ...)) (if (string-prefix-p " " input) (progn ... ...) (setq candidates ...)) (list (cons ... candidates) (cons ... input)))))) (substring-no-properties (selectrum-read prompt candidates :default-candidate def :require-match (eq require-match t) :history 'buffer-name-history :no-move-default-candidate t :may-modify-candidates t :minibuffer-completion-table #'internal-complete-buffer :minibuffer-completion-predicate predicate)))
  selectrum-read-buffer("Switch to buffer: " nil nil (closure ((other-name . "*Ibuffer*") (other-buffer . #<buffer *Ibuffer*>) (current-buffer . #<buffer init.el>) (pr vc . "~/.emacs.d/") t) (buffer) (and (cdr buffer) (equal pr (save-current-buffer (set-buffer (cdr buffer)) (project-current))))))
  read-buffer("Switch to buffer: " nil nil (closure ((other-name . "*Ibuffer*") (other-buffer . #<buffer *Ibuffer*>) (current-buffer . #<buffer init.el>) (pr vc . "~/.emacs.d/") t) (buffer) (and (cdr buffer) (equal pr (save-current-buffer (set-buffer (cdr buffer)) (project-current))))))
  (switch-to-buffer (read-buffer "Switch to buffer: " (if (funcall predicate (cons other-name other-buffer)) (progn other-name)) nil predicate))
  (let* ((pr (project-current t)) (current-buffer (current-buffer)) (other-buffer (other-buffer current-buffer)) (other-name (buffer-name other-buffer)) (predicate #'(lambda (buffer) (and (cdr buffer) (equal pr (save-current-buffer ... ...)))))) (switch-to-buffer (read-buffer "Switch to buffer: " (if (funcall predicate (cons other-name other-buffer)) (progn other-name)) nil predicate)))
  #<subr eval-expression>((let* ((pr (project-current t)) (current-buffer (current-buffer)) (other-buffer (other-buffer current-buffer)) (other-name (buffer-name other-buffer)) (predicate (lambda (buffer) (and (cdr buffer) (equal pr (with-current-buffer ... ...)))))) (switch-to-buffer (read-buffer "Switch to buffer: " (when (funcall predicate (cons other-name other-buffer)) other-name) nil predicate))) nil nil 127)
  apply(#<subr eval-expression> ((let* ((pr (project-current t)) (current-buffer (current-buffer)) (other-buffer (other-buffer current-buffer)) (other-name (buffer-name other-buffer)) (predicate (lambda (buffer) (and (cdr buffer) (equal pr ...))))) (switch-to-buffer (read-buffer "Switch to buffer: " (when (funcall predicate (cons other-name other-buffer)) other-name) nil predicate))) nil nil 127))
  eval-expression((let* ((pr (project-current t)) (current-buffer (current-buffer)) (other-buffer (other-buffer current-buffer)) (other-name (buffer-name other-buffer)) (predicate (lambda (buffer) (and (cdr buffer) (equal pr (with-current-buffer ... ...)))))) (switch-to-buffer (read-buffer "Switch to buffer: " (when (funcall predicate (cons other-name other-buffer)) other-name) nil predicate))) nil nil 127)
  funcall-interactively(eval-expression (let* ((pr (project-current t)) (current-buffer (current-buffer)) (other-buffer (other-buffer current-buffer)) (other-name (buffer-name other-buffer)) (predicate (lambda (buffer) (and (cdr buffer) (equal pr (with-current-buffer ... ...)))))) (switch-to-buffer (read-buffer "Switch to buffer: " (when (funcall predicate (cons other-name other-buffer)) other-name) nil predicate))) nil nil 127)
  command-execute(eval-expression)

@Compro-Prasad
Copy link
Author

Thanks! Can you try to get the backtrace of the first error by using force-debug from here?

Debugger entered--Lisp error: (wrong-type-argument listp " *Minibuf-1*")
  #f(compiled-function (buffer) #<bytecode -0x164efc58dfdb51c0>)(" *Minibuf-1*")
  cl-delete(nil (" *Minibuf-1*" "models.py" ".pylintrc" "*scratch*" " *Minibuf-0*" "*Messages*" " *tab-line-hscroll*" " *Echo Area 0*" " *Echo Area 1*" "*Pipenv*" " *code-conversion-work*" "*lsp-log*" "*pyls*" "*pyls::stderr*" "*Flymake log*" "*eldoc for condition-case*") :if-not #f(compiled-function (buffer) #<bytecode -0x164efc58dfdb51c0>))
  apply(cl-delete nil (" *Minibuf-1*" "models.py" ".pylintrc" "*scratch*" " *Minibuf-0*" "*Messages*" " *tab-line-hscroll*" " *Echo Area 0*" " *Echo Area 1*" "*Pipenv*" " *code-conversion-work*" "*lsp-log*" "*pyls*" "*pyls::stderr*" "*Flymake log*" "*eldoc for condition-case*") :if-not #f(compiled-function (buffer) #<bytecode -0x164efc58dfdb51c0>) nil)
  cl-delete-if-not(#f(compiled-function (buffer) #<bytecode -0x164efc58dfdb51c0>) (" *Minibuf-1*" "models.py" ".pylintrc" "*scratch*" " *Minibuf-0*" "*Messages*" " *tab-line-hscroll*" " *Echo Area 0*" " *Echo Area 1*" "*Pipenv*" " *code-conversion-work*" "*lsp-log*" "*pyls*" "*pyls::stderr*" "*Flymake log*" "*eldoc for condition-case*"))
  #f(compiled-function (input) #<bytecode 0x175677234122da25>)("")
  #f(compiled-function () #<bytecode 0x1c3e08f542baadb1>)()
  apply(#f(compiled-function () #<bytecode 0x1c3e08f542baadb1>) nil)
  (condition-case e (apply func args) ((debug error) (signal (car e) (cdr e))))
  force-debug(#f(compiled-function () #<bytecode 0x1c3e08f542baadb1>))
  apply(force-debug #f(compiled-function () #<bytecode 0x1c3e08f542baadb1>) nil)
  selectrum--minibuffer-post-command-hook()
  read-from-minibuffer("Switch to buffer: " nil (keymap (9 . selectrum-insert-current-candidate) (10 . selectrum-submit-exact-input) (27 keymap (67108991 . backward-kill-sexp)) (remap keymap (previous-matching-history-element . selectrum-select-from-history) (kill-ring-save . selectrum-kill-ring-save) (end-of-buffer . selectrum-goto-end) (beginning-of-buffer . selectrum-goto-beginning) (minibuffer-beginning-of-buffer . selectrum-goto-beginning) (scroll-up-command . selectrum-next-page) (scroll-down-command . selectrum-previous-page) (exit-minibuffer . selectrum-select-current-candidate) (next-line-or-history-element . selectrum-next-candidate) (previous-line-or-history-element . selectrum-previous-candidate) (next-line . selectrum-next-candidate) (previous-line . selectrum-previous-candidate) (minibuffer-keyboard-quit . abort-recursive-edit) (keyboard-quit . abort-recursive-edit)) keymap (remap keymap (previous-matching-history-element . selectrum-select-from-history)) (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (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 "\15" :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 (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil buffer-name-history)
  selectrum-read("Switch to buffer: " #f(compiled-function (input) #<bytecode 0x175677234122da25>) :default-candidate nil :require-match nil :history buffer-name-history :no-move-default-candidate t :may-modify-candidates t :minibuffer-completion-table internal-complete-buffer :minibuffer-completion-predicate #f(compiled-function (buffer) #<bytecode -0x164efc58dfdb51c0>))
  selectrum-read-buffer("Switch to buffer: " nil nil #f(compiled-function (buffer) #<bytecode -0x164efc58dfdb51c0>))
  read-buffer("Switch to buffer: " nil nil #f(compiled-function (buffer) #<bytecode -0x164efc58dfdb51c0>))
  project--read-project-buffer()
  byte-code("\300 C\207" [project--read-project-buffer] 1)
  call-interactively(project-switch-to-buffer nil nil)
  command-execute(project-switch-to-buffer)

@clemera
Copy link
Collaborator

clemera commented Aug 6, 2020

Thanks the problem is the predicate expects a cons see #161. This problem also exists before Emacs 28, the format doesn't seem to be properly documented (at least in Emacs 26.3). Can you confirm it's fixed for you?

@Compro-Prasad
Copy link
Author

It worked. Thanks for the fast fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants