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

deadgrep not using current dired folder as search directory #145

Closed
vnckppl opened this issue Jan 19, 2024 · 3 comments
Closed

deadgrep not using current dired folder as search directory #145

vnckppl opened this issue Jan 19, 2024 · 3 comments

Comments

@vnckppl
Copy link

vnckppl commented Jan 19, 2024

deadgrep no longer searches the underlying folder in dired, but always defaults to searching the home directory. This also happens with emacs -Q:

(add-to-list 'load-path "/home/vincent/.emacs.d/elpa/deadgrep-20231130.1628")
(add-to-list 'load-path "/home/vincent/.emacs.d/elpa/s-20220902.1511")
(add-to-list 'load-path "/home/vincent/.emacs.d/elpa/dash-20240103.1301")
(add-to-list 'load-path "/home/vincent/.emacs.d/elpa/spinner-1.7.4")

(require 's)
(require 'dash)
(require 'spinner)
(require 'deadgrep)

and then running M-x deadgrep. Has this behavior changed?

Deadgrep debug output:

Platform: gnu/linux
Emacs version: 29.1.50
Command: rg --no-config --color=ansi --line-number --no-heading --no-column --with-filename --fixed-strings --smart-case -- test .
default-directory: "~/"

Ripgrep version:

ripgrep 13.0.0

@brongulus
Copy link

brongulus commented Mar 18, 2024

Seeing the same behaviour.
Expected rg to search from the default-directory currently open in dired, however it searched from the project root instead.

@Wilfred
Copy link
Owner

Wilfred commented Mar 19, 2024

Hmm, this is a difficult tradeoff to choose a good default. Note that you can call deadgrep with a prefix to change the search directory before running, or you can override deadgrep-project-root-function to change how deadgrep decides the root directory to start the search from.

Given that this can be overridden, I'm going to close, but I'm open to suggestions of improvements here.

@Wilfred Wilfred closed this as completed Mar 19, 2024
@brongulus
Copy link

brongulus commented Mar 19, 2024

Invoking deadgrep with prefix-argument like C-u M-x deadgrep only prompts for the search term and not the search directory. Am I doing something wrong?

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

3 participants