I'm trying to ignore some file patterns while performing helm-projectile-grep and some with helm-projectile-find-file. I've found that it could be achieved using .dir-locals.el here.
Following this chunk of documentation I've made my .dir-locals.el looks like:
((nil
(grep-find-ignored-files . '("*.log"))
(projectile-globally-ignored-files . '("*.log"))))
When helm-projectile-grep is called it yields an error in helm-projectile:
Error running timer `helm-projectile-grep-or-ack': (wrong-type-argument stringp quote)
Since both emacs manual and projectile docs are sketchy about .dir-locals.el and it's usage I have few questions?
- How
.dir-locals.elworks? Does it merge global and dir-local value of an variable? If I have a variableawhich is'("a" "b")and set it in dir-local to'("c"), what is its value that Emacs use when I perform an operation in certain scope of.dir-locals.el? - What kind of structure is expected in
.dir-locals.elforgrep-find-ignored-filesandprojectile-globally-ignored-files?
On Projectile itself:
- Why Projectile
helm-projectile-grepandhelm-projectile-find-filedon't ignore file patterns which are already ignored in.gitignore? Is it turned off somewhere in my config?
Solution
According to accepted answer, if you want to ignore e.g all the .md files from Projectile operations in your project using .dir-locals.el you should do something like this:
((nil
(eval . (set (make-local-variable 'projectile-globally-ignored-files)
(append projectile-globally-ignored-files
(f-entries (projectile-project-root)
(lambda (f) (string-match "\\.md$" f)) t))))))