dajva / rg.el

Emacs search tool based on ripgrep
https://rgel.readthedocs.io
GNU General Public License v3.0
484 stars 41 forks source link

Ripgreprc not followed #62

Closed rr326 closed 5 years ago

rr326 commented 5 years ago

I have a .ripgreprc in my project root. ripgrep / rg works one way from the command line and a different way when it runs within emacs. I've even added --debug to the command and this is what I see. Note that from the command line the first step is processing .ripgreprc. That does not happen in emacs.

What am I doing wrong?

Command line:

--> /usr/local/bin/rg --color always --colors match:fg:red -n --type-add gn\:\*.gn --type-add gn\:\*.gni --type-add gyp\:\*.gyp --type-add gyp\:\*.gypi --debug -i --no-heading --type py -e booger                                                                                                              [master]  [direnv: python-3.5.4]
DEBUG|rg::config|src/config.rs:40: /Users/rrosen/dev/filing/.ripgreprc: arguments loaded from config file: ["--max-columns=150", "--max-columns-preview", "--glob", "!app/Resources", "--glob", "!app/submodules", "--glob", "!package-lock.json"]
DEBUG|rg::args|src/args.rs:560: final argv: ["/usr/local/bin/rg", "--max-columns=150", "--max-columns-preview", "--glob", "!app/Resources", "--glob", "!app/submodules", "--glob", "!package-lock.json", "--color", "always", "--colors", "match:fg:red", "-n", "--type-add", "gn:*.gn", "--type-add", "gn:*.gni", "--type-add", "gyp:*.gyp", "--type-add", "gyp:*.gypi", "--debug", "-i", "--no-heading", "--type", "py", "-e", "booger"]
DEBUG|grep_regex::literal|grep-regex/src/literal.rs:105: required literals found: [Cut(BOOGE), Cut(bOOGE), Cut(BoOGE), Cut(boOGE), Cut(BOoGE), Cut(bOoGE), Cut(BooGE), Cut(booGE), Cut(BOOgE), Cut(bOOgE), Cut(BoOgE), Cut(boOgE), Cut(BOogE), Cut(bOogE), Cut(BoogE), Cut(boogE), Cut(BOOGe), Cut(bOOGe), Cut(BoOGe), Cut(boOGe), Cut(BOoGe), Cut(bOoGe), Cut(BooGe), Cut(booGe), Cut(BOOge), Cut(bOOge), Cut(BoOge), Cut(boOge), Cut(BOoge), Cut(bOoge), Cut(Booge), Cut(booge)]
DEBUG|globset|globset/src/lib.rs:435: built glob set; 2 literals, 1 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes

From within emacs

-*- mode: rg; default-directory: "~/dev/filing/" -*-
rg started at Tue Sep 10 08:18:30

/usr/local/bin/rg --color always --colors match:fg:red -n --type-add gn\:\*.gn --type-add gn\:\*.gni --type-add gyp\:\*.gyp --type-add gyp\:\*.gypi --debug -i --no-heading --type py -e booger

DEBUG|grep_regex::literal|grep-regex/src/literal.rs:105: required literals found: [Cut(BOOGE), Cut(bOOGE), Cut(BoOGE), Cut(boOGE), Cut(BOoGE), Cut(bOoGE), Cut(BooGE), Cut(booGE), Cut(BOOgE), Cut(bOOgE), Cut(BoOgE), Cut(boOgE), Cut(BOogE), Cut(bOogE), Cut(BoogE), Cut(boogE), Cut(BOOGe), Cut(bOOGe), Cut(BoOGe), Cut(boOGe), Cut(BOoGe), Cut(bOoGe), Cut(BooGe), Cut(booGe), Cut(BOOge), Cut(bOOge), Cut(BoOge), Cut(boOge), Cut(BOoge), Cut(bOoge), Cut(Booge), Cut(booge)]
DEBUG|globset|globset/src/lib.rs:435: built glob set; 0 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 1 required extensions, 0 regexes
dajva commented 5 years ago

Are you missing RIPGREP_CONFIG_PATH env setting from within emacs?

rr326 commented 5 years ago

Yes - that's it! Thank you.

(I had assumed it rg always looked up your hierarchy, but apparently that was some functionality I added myself with direnv. Too clever for my own good!)