armindarvish / consult-gh

An Interactive interface for "GitHub CLI" client inside GNU Emacs using Consult

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warning (comp): consult-gh-embark.el: Error: Symbol's value as variable is void consult-preview-key

ParetoOptimalDev opened this issue · comments

Describe the bug

Using the config in the readme and emacs -q I get this error.

To Reproduce

(use-package magit)
(use-package forge)
(use-package consult-gh
  :custom
  (consult-gh-default-clone-directory "~/projects")
  (consult-gh-show-preview t)
  (consult-gh-preview-key "M-o")
  (consult-gh-repo-action #'consult-gh--repo-browse-files-action)
  (consult-gh-issue-action #'consult-gh--issue-view-action)
  (consult-gh-pr-action #'consult-gh--pr-view-action)
  (consult-gh-code-action #'consult-gh--code-view-action)
  (consult-gh-file-action #'consult-gh--files-view-action)
  (consult-gh-large-file-warning-threshold 2500000)
  (consult-gh-prioritize-local-folder 'suggest)
  :config
  ;;add your main GitHub account (replace "armindarvish" with your user or org)
  (add-to-list 'consult-gh-default-orgs-list "armindarvish")
  (require 'consult-gh-embark)
  (require 'consult-gh-forge))

Run with emacs -q --load "/tmp/config-with-consult-gh.el" and you'll see:

 ■  Warning (comp): /nix/store/v1qlivay055fvfnrsrkhm623vy0vqd25-emacs-packages-deps/share/emacs/site-lisp/consult-gh-forge.el: Error: Symbol's value as variable is void consult-preview-key
 ■  Warning (comp): /nix/store/v1qlivay055fvfnrsrkhm623vy0vqd25-emacs-packages-deps/share/emacs/site-lisp/consult-gh-embark.el: Error: Symbol's value as variable is void consult-preview-key

Expected behavior
No error loading since consult-preview-key is already defined. When I do C-h v consult-preview-key I see it's help page.

Important Information:

  • OS: NixOS
  • Version of Emacs 30
  • Version of gh (run gh --version in a shell)
  • Version of consult: consult-20231110.926
  • The installation method and the configuration you are using with your consult-gh: Nix

Additional context

I also tried using use-package but I think since these are comp errors it doesn't help?

(use-package consult-gh
  :after (consult magit forge)
:custom
  (consult-gh-default-clone-directory "~/projects")
  (consult-gh-show-preview t)
  (consult-gh-preview-key "M-o")
  (consult-gh-repo-action #'consult-gh--repo-browse-files-action)
  (consult-gh-issue-action #'consult-gh--issue-view-action)
  (consult-gh-pr-action #'consult-gh--pr-view-action)
  (consult-gh-code-action #'consult-gh--code-view-action)
  (consult-gh-file-action #'consult-gh--files-view-action)
  (consult-gh-large-file-warning-threshold 2500000)
  (consult-gh-prioritize-local-folder 'suggest)
  :config
  ;;add your main GitHub account (replace "armindarvish" with your user or org)
  (add-to-list 'consult-gh-default-orgs-list "armindarvish"))

  (use-package consult-gh-embark
    :after (consult consult-gh embark forge magit))

  (use-package consult-gh-forge
    :after (consult consult-gh embark forge magit))

Actually.. it seems that final one does work to silence this bug.

@ParetoOptimalDev You need to load consult (a.k.a. (use-package consult) before loading consult-gh. That's why you get the error you showed!

The second config should just work because you have :after (consult ...) in there and I think your last comment is saying that works! So everything is as expected. I am not sure what the issue is? I'm closing this issue now. Feel free to reopen if there is some issues I am missing here.