7

I want setup the projectile project for project that has no local git, hg, bzr, etc. directories so I cannot use their repositories as source of project files. Is it enough to just create the .projectile file in the root directory and use the C-u C-c p f to refresh the cache. I've tried this and in my case it is not working (my .projectile is empty - shall I fill it with some rules?). What I would expect is the emacs/projectile to automatically index all my project, i.e. directory-by-directory, file-by-file, so I can make later quick search for the files.

Could you please give me some step-by-step hints ?

Thanks!

[--Update--]
This is an excerpt from my .emacs config file:

(require 'projectile)  
(projectile-global-mode)  
(setq projectile-indexing-method 'native)  
(setq projectile-enable-caching t)  

After the C-c p f sequence I'm asked by the "Find file:" prompt but the only file in the list is the .projectile file itself - none of the project files are displayed.

Rorschach
  • 31,301
  • 5
  • 78
  • 129
michal.szulc
  • 71
  • 1
  • 4
  • What values you have for `projectile-enable-caching` and `projectile-indexing-method`? The empty .projectile approach is valid. What happens when you hit `C-c p f`? – juanleon Dec 13 '13 at 14:15
  • @juanleon: I've updated the question above – michal.szulc Dec 13 '13 at 14:36
  • Strange. That setups works for me. Does `projectile-globally-ignored-directories` or `projectile-globally-ignored-files` match the rest of the files? What versions of Emacs/projectile are you using (I assume you are using Windows, because of the native indexing method)? – juanleon Dec 13 '13 at 14:48
  • By the way, your .projectile is meant to remain empty; the cache is stored in a different place (file projectile.cache, on your ~/.emacs.d or similar) – juanleon Dec 13 '13 at 14:52
  • None of the `projectile-globally-ignored-directories` directories or `projectile-globally-ignored-file` files match any of the files/directories in my project. The project includes mainly (~99,9%) `*.c`, `*.h` and Makefiles – michal.szulc Dec 13 '13 at 15:58
  • I'm running the whole stuff on Win7. Emacs ver. 24.3.1, projectile ver. 0.10.0. – michal.szulc Dec 13 '13 at 16:05
  • By saying that the setup works for you, you mean that: 1) open the .projectile file in the projects' top-level dir 2) `M-x projectile-find-file` and starts to type the beginning of some filename from inside the project 3) that filename is being expanded to the full filename 4) you can open that file – michal.szulc Dec 13 '13 at 16:19
  • Right. I started with exact same configuration and versions than you ("emacs -q" + your lines) and `projectile-find-file` is working as usual (I can complete and open all files in project). I use Linux, though. – juanleon Dec 13 '13 at 16:29
  • When Emacs is filling the cache with new data? At the beginning of the `C-c p f` sequence? – michal.szulc Dec 13 '13 at 16:56
  • Exactly, if the cache is empty (or you use C-u) and `projectile-enable-caching` is not nil. You can check if the cache is empty by looking at projectile.cache file. – juanleon Dec 13 '13 at 18:49

1 Answers1

10

Currently, I have found out that after you have created a .projectile file in the directory of your choice, projectile will only use it after you restart emacs from that directory.

The caching is working well.

Jiehong
  • 786
  • 1
  • 7
  • 16