helm-ag icon indicating copy to clipboard operation
helm-ag copied to clipboard

ag seems to not be honoring `--path-to-ignore` when run through heml

Open togakangaroo opened this issue 4 years ago • 1 comments

  • Emacs version 26.2
  • Operating system macOS Mojave v10.14.6
  • Search command(ag, pt, ack etc) and version ag 2.2.0
  • Last value of helm-ag--last-command
ELISP> helm-ag--last-command
("ag" "--nocolor" "--nogroup" "--path-to-ignore" "~/.ignore" "button")

Actual behavior

I want to use a global ~/.ignore using the --path-to-ignore option. I have configured things thus

ELISP> helm-ag-command-option
"--path-to-ignore ~/.ignore"

When I run helm-project-do-ag and search for "button", I am getting results from ignored directories like node_modules

Expected behavior

I expect node_modules to not be searched. Running things on the command line returns results correctly by ignoring things.

ag --nogroup --path-to-ignore ~/.ignore "button" .

obviously that last-command up there seems to indicate the option worked, so its rather confusing what the issue could possibly be

togakangaroo avatar Sep 24 '19 21:09 togakangaroo

@togakangaroo I apologize my late reply.

You need to expand ~ as below. Emacs does not expand ~ as home directory automatically. (While shell like bash, zsh expands it automatically) .

(setq helm-ag-command-option
      (format "--path-to-ignore %s" (expand-file-name "~/ignore")))

syohex avatar Mar 27 '20 15:03 syohex