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 when using marginalia with vertico #158

Closed
daruuro opened this issue Apr 8, 2023 · 3 comments
Closed

Error in post-command-hook when using marginalia with vertico #158

daruuro opened this issue Apr 8, 2023 · 3 comments

Comments

@daruuro
Copy link

daruuro commented Apr 8, 2023

Getting error:

error in post-command-hook (vertico--exhibit) (void-function function-alias-p)

When starting up Emacs 29.0.50 with init.el:

;; Use develop branch of straight to get around
;; native compilation errors. TODO: fix this.
(setq straight-repository-branch "develop")

;; Bootstrap straight
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 6))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

;; Install use-package
(straight-use-package 'use-package)

;; Configure use-package to use straight by default
(use-package straight
  :custom
  (straight-use-package-by-default t))

;; Enable vertico
(use-package vertico
  :init
  (vertico-mode))

;; Enable rich annotations using the Marginalia package
(use-package marginalia
  :init
  (marginalia-mode))

(setq debug-on-error t)

(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)

Here is the debug log:

Debugger entered--Lisp error: (void-function function-alias-p)
  function-alias-p(execute-extended-command)
  marginalia-classify-by-command-name()
  marginalia--completion-metadata-get((metadata (affixation-function . read-extended-command--affixation) (category . command)) category)
  apply(marginalia--completion-metadata-get ((metadata (affixation-function . read-extended-command--affixation) (category . command)) category))
  completion-metadata-get((metadata (affixation-function . read-extended-command--affixation) (category . command)) category)
  vertico--metadata-get(category)
  vertico--update(interruptible)
  #<subr vertico--exhibit>()
  apply(#<subr vertico--exhibit> nil)
  (condition-case e (apply func args) ((debug error) (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 0x1ec8173af1f79b5b>) t nil extended-command-history nil nil)
  apply((#<subr completing-read-default> "M-x " #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_49> #f(compiled-function (sym) #<bytecode 0x1ec8173af1f79b5b>) 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 0x1ec8173af1f79b5b>) 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 0x1ec8173af1f79b5b>) t nil extended-command-history nil nil))
  completing-read-default("M-x " #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_49> #f(compiled-function (sym) #<bytecode 0x1ec8173af1f79b5b>) 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)

Any and all help is appreciated.

@minad
Copy link
Owner

minad commented Apr 9, 2023

Make sure that you install Compat. I recommend that you avoid Straight, since it ignores dependencies and doesn't update them properly.

@minad minad closed this as completed Apr 9, 2023
@daruuro
Copy link
Author

daruuro commented Apr 10, 2023

Make sure that you install Compat.

As far as I can tell, with that given init.el, straight installs compat correctly:

daruur@cumulo ~/.emacs.d> ls straight/build
bind-key  compat  marginalia  straight  use-package  vertico
daruur@cumulo ~/.emacs.d>

I recommend that you avoid Straight, since it ignores dependencies and doesn't update them properly.

I didn't know that, do you have a source for this? The readme makes many mentions of dependency management: https://github.com/radian-software/straight.el/blob/master/README.md

@minad
Copy link
Owner

minad commented Apr 10, 2023

Straight doesn't seem to respect version constraints since it pulls from git directly. I have seen multiple issues where this was the case.

Here the problem could also be your outdated Emacs development version.

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

2 participants