minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.22k stars 102 forks source link

Error when running consult-ripgrep: `Keyword argument :hidden not one of (..list..)` #722

Closed rodrigovalin closed 1 year ago

rodrigovalin commented 1 year ago

Installed version: 20230116.1333

Error message on Messages buffer:

consult--read-1: Keyword argument :hidden not one of (:prompt :predicate :require-match :history :default :keymap :category :initial :narrow :add-history :annotate :state :preview-key :sort :lookup :group :inherit-input-method)

Elisp debugger:

Debugger entered--Lisp error: (error "Keyword argument :hidden not one of (:prompt :pred...")
  signal(error ("Keyword argument :hidden not one of (:prompt :pred..."))
  error("Keyword argument %s not one of (:prompt :predicate..." :hidden)
  consult--read-1(#f(compiled-function (action) #<bytecode 0xbbba060889e3c6f>) :preview-key (:debounce 0.4 any) :default nil :hidden t :prompt "Ripgrep (Project xx): " :lookup consult--lookup-member :state #f(compiled-function (action cand) #<bytecode -0x5247e97cedb589b>) :initial "#" :add-history #("#given" 1 6 (fontified t face font-lock-doc-face)) :require-match t :category consult-grep :group consult--grep-group :history (:input consult--grep-history) :sort nil :prompt "Select: " :preview-key any :sort t :lookup #f(compiled-function (selected &rest _) #<bytecode 0x16ff80caa42b639b>))
  apply(consult--read-1 #f(compiled-function (action) #<bytecode 0xbbba060889e3c6f>) (:preview-key (:debounce 0.4 any) :default nil :hidden t :prompt "Ripgrep (Project xx): " :lookup consult--lookup-member :state #f(compiled-function (action cand) #<bytecode -0x5247e97cedb589b>) :initial "#" :add-history #("#given" 1 6 (fontified t face font-lock-doc-face)) :require-match t :category consult-grep :group consult--grep-group :history (:input consult--grep-history) :sort nil :prompt "Select: " :preview-key any :sort t :lookup #f(compiled-function (selected &rest _) #<bytecode 0x16ff80caa42b639b>)))
  consult--read(#f(compiled-function (action) #<bytecode 0xbbba060889e3c6f>) :prompt "Ripgrep (Project xx): " :lookup consult--lookup-member :state #f(compiled-function (action cand) #<bytecode -0x5247e97cedb589b>) :initial "#" :add-history #("#given" 1 6 (fontified t face font-lock-doc-face)) :require-match t :category consult-grep :group consult--grep-group :history (:input consult--grep-history) :sort nil)
  consult--grep("Ripgrep" #f(compiled-function (input) #<bytecode -0xb9a3ffb2ec760a2>) nil nil)
  consult-ripgrep(nil)
  funcall-interactively(consult-ripgrep nil)

I tried recompiling the whole directory thinking that the elc files might need a refresh.

(byte-recompile-directory "~/.emacs.d/elpa/consult-20230116.1333" 0 t)
;; (byte-recompile-directory "<directory>" <0 = compile all the files> <t = force compilation>)
minad commented 1 year ago

That's a bug in another package or your configuration. Please follow https://github.com/minad/consult#bug-reports.

rodrigovalin commented 1 year ago

All right, I found the error and it was in my configuration. In init.el I had:

(use-package consult
  ;; other configuration ...
  :config
  (consult-customize
   ;; following line was making consult-ripgrep to fail, passing it the non-recognized :hidden attribute.
   consult-ripgrep :hidden t :default nil :preview-key '(:debounce 0.4 any)))

Removing :hidden from consult-customize fixed the issue.