Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil) #27

Closed
tumashu opened this issue May 6, 2021 · 9 comments

Comments

@tumashu
Copy link

tumashu commented May 6, 2021

0.6 seem no this problem, 0.7 has this problem

@minad
Copy link
Owner

minad commented May 6, 2021

You are probably using an outdated version of Emacs 28. Please check that you are using the latest Vertico version and check the Emacs version you are using. It must be newer than emacs-mirror/emacs@d8e037e. Emacs 27 works too.

@daviwil
Copy link

daviwil commented May 6, 2021

I can confirm this problem goes away with newer Emacs 28. Smooth sailing with Vertico right now!

@minad
Copy link
Owner

minad commented May 7, 2021

@tumashu Did updating fix your issue? Vertico works without issues for me on 27.1 and the current Emacs master.

@minad minad closed this as completed May 7, 2021
@tumashu
Copy link
Author

tumashu commented May 7, 2021

seem to solved, :-)

@blahgeek
Copy link

I encountered the same problem ((vertico--exhibit): (wrong-type-argument stringp nil)) today with latest emacs 28.

I've been using vertico for several days without any problems, but today this error just popped up for no reason. (I don't think I did anything abnormal, maybe pressed C-g in the middle of completing read.) After it appeared once, it did not ever go away: I could not run any other commands involving completing-read from then. So I had to restart emacs and it came back to normal. I cannot reproduce it now.

Is there anything I can do to help debugging this issue in case I encountered it again? (but since I cannot run any commands involving completing-read at that time, it could be very difficult)

@minad
Copy link
Owner

minad commented Dec 15, 2021

@blahgeek You evaluate the following first to produce a stacktrace:

(defun force-debug (func &rest args)
  (condition-case e
      (apply func args)
    ((debug error) (signal (car e) (cdr e)))))

(advice-add #'vertico--exhibit :around #'force-debug)

With a stack trace it is easier to debug this. Furthermore you should tell me which command is exactly affected by the issue. Anyways - Vertico should get back to normal even if this error occured if you start a new completing-read session. Restarting Emacs is not necessary. I have not seen this issue on Emacs 28. Emacs 28 is already pretty stable, I tested it just a few days ago.

@Eason0210
Copy link

Eason0210 commented Jan 10, 2022

@minad I also got this error when I press C-h v with latest commit of vertico + latest marginalia:

Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil)

With git bitsec and I can confirmed that this issue happened at 1a24952 * Colorize truncation ellipsis and later commit of marginalia .

So, this issue may be caused by marginalia?

@blahgeek
Copy link

blahgeek commented Mar 3, 2022

I encountered this issue again: all commands using vertico (e.g. find-file, M-x, etc.) starts to fail. Error message:

Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp ("\\(?:co\\)"))
Quit
Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil)
Quit
Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil)
Quit [8 times]
Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil)
Quit
Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil)
Error in post-command-hook (consult--preview-post-command): (wrong-type-argument stringp nil)
orderless-pattern-compiler: Wrong type argument: stringp, nil [9 times]
Quit
Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil)
Quit
Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil)
Quit
Debug on Error enabled globally
Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil)
Quit
Error in post-command-hook (vertico--exhibit): (wrong-type-argument stringp nil)
Error in post-command-hook (consult--preview-post-command): (wrong-type-argument stringp nil)
Quit

Here's the backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  split-string(nil " +" t)
  orderless-pattern-compiler(nil)
  orderless-highlight-matches(nil ("evil-collection-magit-toggle-text-minor-mode" "magit-section-show-headings" "flycheck-list-errors" "evil-find-file-at-point-visual" "pr-ps-file-preview" "lsp-treemacs-cycle-severity" "sgml-mode" "magit-patch-save" "c-electric-lt-gt" "help-follow-symbol"))
  #f(compiled-function (x) #<bytecode -0x1433a9504704410e>)(("evil-collection-magit-toggle-text-minor-mode" "magit-section-show-headings" "flycheck-list-errors" "evil-find-file-at-point-visual" "pr-ps-file-preview" "lsp-treemacs-cycle-severity" "sgml-mode" "magit-patch-save" "c-electric-lt-gt" "help-follow-symbol"))
  vertico--arrange-candidates()
  #<subr vertico--exhibit>()
  apply(#<subr vertico--exhibit> nil)
  (condition-case e (apply func args) ((debug error) (message "HERE: %s" (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (backtrace) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (signal (car e) (cdr e))))
  force-debug(#<subr vertico--exhibit>)
  apply(force-debug #<subr vertico--exhibit> nil)
  vertico--exhibit()
  #<subr completing-read-default>("M-x " #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_49> #f(compiled-function (sym) #<bytecode -0x19ff91b7be9671d1>) t nil extended-command-history nil nil)
  vertico--advice(#<subr completing-read-default> "M-x " #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_49> #f(compiled-function (sym) #<bytecode -0x19ff91b7be9671d1>) t nil extended-command-history nil nil)
  apply(vertico--advice #<subr completing-read-default> ("M-x " #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_49> #f(compiled-function (sym) #<bytecode -0x19ff91b7be9671d1>) t nil extended-command-history nil nil))
  completing-read-default("M-x " #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_49> #f(compiled-function (sym) #<bytecode -0x19ff91b7be9671d1>) t nil extended-command-history nil nil)
  read-extended-command()
  byte-code("\302\30\11\303 \10E)\207" [execute-extended-command--last-typed current-prefix-arg nil read-extended-command] 3)
  command-execute(execute-extended-command)

@blahgeek
Copy link

blahgeek commented Mar 3, 2022

Update: so the problem seems to be in "orderless" package. I did some debugging and the result is very strange:

  1. In this problematic emacs, I executed (orderless-highlight-matches nil '("hello" "world")) in scratch buffer, it throwed error
  2. However, in another newly started emacs, I executed the same code and it's OK
  3. In the problematic emacs, I executed the (defun orderless-highlight-matches ... block again, then everything went back to normal

It seems that the definition of orderless-highlight-matches function got modified somehow...?

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

No branches or pull requests

5 participants