doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.2k stars 3.03k forks source link

`error: (wrong-type-argument overlayp nil)` when calling some consult funcs (doom emacs, macos) #7964

Open fullofcaffeine opened 1 month ago

fullofcaffeine commented 1 month ago

I confirm that...

Expected behavior

Hi!

I'm trying to use consult for ripgrep, and after installing consult in my Doom emacs distro, and calling the consult-ripgrep func, I get an error.

And it then aborts execution.

Most consult functions are throwing this error, but some functions work, like consult-line and consult-file.

Any ideas on what could be wrong here? Any advice would be greatly appreciated!

Thanks in advance!

Current behavior

This error is thrown when I run consult-ripgrep:

Debugger entered--Lisp error: (wrong-type-argument overlayp nil)
delete-overlay(nil)
  #f(compiled-function (action &optional state) #<bytecode 0x82f8e4ef3fdf983>)(destroy)
  #f(compiled-function (action) #<bytecode 0x1d073030a8e66d82>)(destroy)
  #f(compiled-function (action) #<bytecode 0x1f81849219526162>)(destroy)
  #f(compiled-function (action) #<bytecode 0x19651c975f4929c1>)(destroy)
  #f(compiled-function () #<bytecode 0xa2271ca939dc3f4>)()
  consult--read-1(#f(compiled-function (action) #<bytecode 0x19651c975f4929c1>) :prompt #("Ripgrep (…/org/roam-wiki/): " 9 25 (help-echo "/my/org/repo")) :lookup consult--lookup-member :state #f(compiled-function (action cand) #<bytecode -0x1c46cf9955c47520>) :initial "#" :add-history nil :require-match t :category consult-grep :group consult--prefix-group :history (:input consult--grep-history) :sort nil :prompt "Select: " :preview-key any :sort t :lookup #f(compiled-function (selected &rest _) #<bytecode 0x16ffc4caa42b639b>))
  apply(consult--read-1 #f(compiled-function (action) #<bytecode 0x19651c975f4929c1>) (:prompt #("Ripgrep (…/org/roam-wiki/): " 9 25 (help-echo "/my/org/repo")) :lookup consult--lookup-member :state #f(compiled-function (action cand) #<bytecode -0x1c46cf9955c47520>) :initial "#" :add-history nil :require-match t :category consult-grep :group consult--prefix-group :history (:input consult--grep-history) :sort nil :prompt "Select: " :preview-key any :sort t :lookup #f(compiled-function (selected &rest _) #<bytecode 0x16ffc4caa42b639b>)))
  consult--read(#f(compiled-function (action) #<bytecode 0x19651c975f4929c1>) :prompt #("Ripgrep (…/org/roam-wiki/): " 9 25 (help-echo "/my/org/repo")) :lookup consult--lookup-member :state #f(compiled-function (action cand) #<bytecode -0x1c46cf9955c47520>) :initial "#" :add-history nil :require-match t :category consult-grep :group consult--prefix-group :history (:input consult--grep-history) :sort nil)
  consult--grep("Ripgrep" consult--ripgrep-make-builder "/my/org/repo" "")
  consult-ripgrep("/my/org/repo" "")
  (let ((consult-ripgrep-command "rg --multiline --null --ignore-case --type org --l...")) (consult-ripgrep org-roam-directory ""))
  local/org-roam-rg-search()
  funcall-interactively(local/org-roam-rg-search)
  call-interactively(local/org-roam-rg-search record nil)
  command-execute(local/org-roam-rg-search record)

System information:

Steps to reproduce

  1. Open emacs
  2. M-x consult-ripgrep
  3. Error is thrown, function aborts execution.

System Information

https://gist.github.com/fullofcaffeine/e892f17d032708e5ea42a1916df46beb

hlissner commented 1 month ago

I can't reproduce these errors in vanilla Doom with the :completion vertico module installed, so I'd wager this is a configuration or byte-compilation issue. Try doom sync --rebuild to resolve the latter (it will recompile all installed packages).

Side note: your M-x doom/info shows a few minor oddities:

Nothing else jumps out at me at the moment.

fullofcaffeine commented 1 month ago

Thanks for the reply!

You've disabled the magit package, but the :tools magit module is disabled.

Shouldn't it be disabled in that case?

You have both the :completion helm and :completion vertico modules enabled. The ivy, helm, vertico, and ido modules are not compatible with each other, generally, and could cause issues if they're enabled together. It might help to try disabling helm. The fact you have helm-projectile installed may be contributing to your issue, as well.

Oh, good point. I actually like and prefer helm. Is there a way to get consult to work with helm? I want to use consult as an interface to ripgrep, as described here: https://org-roam.discourse.group/t/is-there-a-simple-scalable-way-to-do-full-text-search/2097/2, but maybe I could get that to work with helm, too.

hlissner commented 1 week ago

Is there a way to get consult to work with helm

There is not. consult was made solely for vertico. However, Doom's helm module should already have a ripgrep command (+helm/project-search on SPC s p, which uses ripgrep under the hood).


Did disabling :completion vertico or running doom sync --rebuild fix this issue, by the way?