Error when `global-corfu-modes` is not `t`
rrudakov opened this issue · comments
Roman Rudakov commented
Steps to reproduce
emacs -q
- evaluate the following in the
*scratch*
buffer:
(package-initialize)
(require 'corfu)
(setopt global-corfu-modes '((not eshell-mode)))
(global-corfu-mode 1)
- Type part of some expression and execute
cofru-complete
.
Expected result
Popup with completion candidates is visible.
Actual result
Error:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
-(261 nil)
(max 0 (- (point) beg))
(let* ((pt (max 0 (- (point) beg))) (str (buffer-substring-no-properties beg end)) (metadata (completion-metadata (substring str 0 pt) table pred))) (let* ((val (completion-try-completion str table pred pt metadata))) (cond ((eq val 't) (let nil (goto-char end) (corfu--done str 'finished))) ((consp val) (let* ((x65 (car-safe val)) (x66 (cdr-safe val))) (let ((newstr x65) (newpt x66)) (if (equal str newstr) nil (completion--replace beg end ...)) (goto-char (+ beg newpt)) (if (and ... ...) (progn ...))))))))
(if (>= corfu--index 0) (progn (corfu--insert nil) (let ((newstr (buffer-substring-no-properties beg end))) (if (and (test-completion newstr table pred) (or (not (consp ...)) (equal (completion-boundaries newstr table pred "") '...))) (progn (corfu--done newstr 'finished))))) (let* ((pt (max 0 (- (point) beg))) (str (buffer-substring-no-properties beg end)) (metadata (completion-metadata (substring str 0 pt) table pred))) (let* ((val (completion-try-completion str table pred pt metadata))) (cond ((eq val 't) (let nil (goto-char end) (corfu--done str 'finished))) ((consp val) (let* ((x65 ...) (x66 ...)) (let (... ...) (if ... nil ...) (goto-char ...) (if ... ...))))))))
(let ((beg x57) (end x59) (table x61) (pred x63)) (if (>= corfu--index 0) (progn (corfu--insert nil) (let ((newstr (buffer-substring-no-properties beg end))) (if (and (test-completion newstr table pred) (or (not ...) (equal ... ...))) (progn (corfu--done newstr 'finished))))) (let* ((pt (max 0 (- (point) beg))) (str (buffer-substring-no-properties beg end)) (metadata (completion-metadata (substring str 0 pt) table pred))) (let* ((val (completion-try-completion str table pred pt metadata))) (cond ((eq val 't) (let nil (goto-char end) (corfu--done str ...))) ((consp val) (let* (... ...) (let ... ... ... ...))))))))
(progn (ignore (null x64)) (let ((beg x57) (end x59) (table x61) (pred x63)) (if (>= corfu--index 0) (progn (corfu--insert nil) (let ((newstr (buffer-substring-no-properties beg end))) (if (and (test-completion newstr table pred) (or ... ...)) (progn (corfu--done newstr ...))))) (let* ((pt (max 0 (- ... beg))) (str (buffer-substring-no-properties beg end)) (metadata (completion-metadata (substring str 0 pt) table pred))) (let* ((val (completion-try-completion str table pred pt metadata))) (cond ((eq val ...) (let nil ... ...)) ((consp val) (let* ... ...))))))))
(let* ((x63 (car-safe x62)) (x64 (cdr-safe x62))) (progn (ignore (null x64)) (let ((beg x57) (end x59) (table x61) (pred x63)) (if (>= corfu--index 0) (progn (corfu--insert nil) (let ((newstr ...)) (if (and ... ...) (progn ...)))) (let* ((pt (max 0 ...)) (str (buffer-substring-no-properties beg end)) (metadata (completion-metadata ... table pred))) (let* ((val ...)) (cond (... ...) (... ...))))))))
(progn (ignore (consp x62)) (let* ((x63 (car-safe x62)) (x64 (cdr-safe x62))) (progn (ignore (null x64)) (let ((beg x57) (end x59) (table x61) (pred x63)) (if (>= corfu--index 0) (progn (corfu--insert nil) (let (...) (if ... ...))) (let* ((pt ...) (str ...) (metadata ...)) (let* (...) (cond ... ...))))))))
(let* ((x61 (car-safe x60)) (x62 (cdr-safe x60))) (progn (ignore (consp x62)) (let* ((x63 (car-safe x62)) (x64 (cdr-safe x62))) (progn (ignore (null x64)) (let ((beg x57) (end x59) (table x61) (pred x63)) (if (>= corfu--index 0) (progn (corfu--insert nil) (let ... ...)) (let* (... ... ...) (let* ... ...))))))))
(progn (ignore (consp x60)) (let* ((x61 (car-safe x60)) (x62 (cdr-safe x60))) (progn (ignore (consp x62)) (let* ((x63 (car-safe x62)) (x64 (cdr-safe x62))) (progn (ignore (null x64)) (let ((beg x57) (end x59) (table x61) (pred x63)) (if (>= corfu--index 0) (progn ... ...) (let* ... ...))))))))
(let* ((x59 (car-safe x58)) (x60 (cdr-safe x58))) (progn (ignore (consp x60)) (let* ((x61 (car-safe x60)) (x62 (cdr-safe x60))) (progn (ignore (consp x62)) (let* ((x63 (car-safe x62)) (x64 (cdr-safe x62))) (progn (ignore (null x64)) (let (... ... ... ...) (if ... ... ...))))))))
(progn (ignore (consp x58)) (let* ((x59 (car-safe x58)) (x60 (cdr-safe x58))) (progn (ignore (consp x60)) (let* ((x61 (car-safe x60)) (x62 (cdr-safe x60))) (progn (ignore (consp x62)) (let* ((x63 ...) (x64 ...)) (progn (ignore ...) (let ... ...))))))))
(let* ((x57 (car-safe completion-in-region--data)) (x58 (cdr-safe completion-in-region--data))) (progn (ignore (consp x58)) (let* ((x59 (car-safe x58)) (x60 (cdr-safe x58))) (progn (ignore (consp x60)) (let* ((x61 (car-safe x60)) (x62 (cdr-safe x60))) (progn (ignore (consp x62)) (let* (... ...) (progn ... ...))))))))
(progn (ignore (consp completion-in-region--data)) (let* ((x57 (car-safe completion-in-region--data)) (x58 (cdr-safe completion-in-region--data))) (progn (ignore (consp x58)) (let* ((x59 (car-safe x58)) (x60 (cdr-safe x58))) (progn (ignore (consp x60)) (let* ((x61 ...) (x62 ...)) (progn (ignore ...) (let* ... ...))))))))
corfu-complete()
funcall-interactively(corfu-complete)
command-execute(corfu-complete record)
execute-extended-command(nil "corfu-complete" "corfu-comp")
funcall-interactively(execute-extended-command nil "corfu-complete" "corfu-comp")
command-execute(execute-extended-command)
Screenshot
Related problem
Looks like type for defcustom global-corfu-modes
is not entirely correct. When I'm trying to evaluate (setopt global-corfu-modes t)
(back to the original value), I'm getting an error:
⛔ Warning (emacs): Value ‘t’ does not match type (repeat sexp)
Daniel Mendler commented
I fixed the type error. I've not seen the other issue so far. Which Emacs version do you use?
Edit: Your usage of corfu is incorrect. You should invoke completion-at-point, not corfu-complete.
Roman Rudakov commented
Roman Rudakov commented
@minad should I provide any additional information? Or maybe I should create another issue? For some reason I cannot re-open this one.
Daniel Mendler commented
On 11/1/23 18:07, Roman Rudakov wrote:
@minad <https://github.com/minad> should I provide any additional
information? Or maybe I should create another issue? For some reason I
cannot re-open this one.
It seems your `global-corfu-modes` setting is not correct. The list
should end in a final `t`. See #379.
Roman Rudakov commented
That wasn't obvious :) Thank you for pointing it out.