emacs projectile - initialize project cache without git, hg, etc. repository - emacs

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.

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.

Related

emacs projectile: how to add multiple folders to project (like vscode)?

I am new to emacs, coming from VSCode, trying to setup projectile. So far my configuration includes:
(use-package projectile
:ensure t
:diminish projectile-mode
:config (projectile-mode)
:custom ((projectile-completion-system 'helm))
:bind-keymap
("C-c p" . projectile-command-map)
:init
(when (file-directory-p "/home/user/code")
(setq projectile-project-search-path '("/home/user/code"))))
One of the things I loved in VSCode is the ability to create .code-workspace files. Within such a file, I could specify multiple directories that would be included in my workspace.
The projectile notion of a project (https://docs.projectile.mx/projectile/projects.html) seems to always associate a project with one root directory.
Is there any way in which I could use multiple root directories in a project? Could the .projectile file accomplish the same as the .code-workspace file?

cedet ede project for emacs

I am trying learn how to work with CEDET. I don't have any project to mess around so I want to shoot Emacs itself.
It seems CEDET automatically detects Emacs as a project when I open Emacs repository in dir. But when I do M-x ede-find-file there is no file to open.
Question is, How can I exactly setup Emacs as a project in CEDET to make use of EDE and other goodies of CEDET.?
Seems the documentation for this hasn't been completed yet.
The command ede-find-file doesn't provide completion. If you are visiting some file in the Emacs source (like INSTALL) and do this:
M-x ede-find-file RET emacs.c RET
it should pop up emacs.c.
Different CEDET features all have different kinds of dependencies so it's hard to answer the question specifically, but generically, all you have to do is visit a file in your Emacs project, and the other features should be enabled.
I think, that it should be added the same way as other EDE projects, with something like:
(setq emacs-project
(ede-emacs-project "emacs-head"
:file "/home/ott/work/emacs-head/README"))
At least this works for me...

how can I shadow the .el files from the Emacs directory with the ones I specify in my init file

So list-load-path-shadows tells which .el files shadow other files. Most of the times the native files found in my emacs distribution shadow newer files I downloaded which I preload in my init file.
For example I have cloned the cedet repository and have that always up to date but the cedet files inside my Emacs 23.4 shadow the newer cedet files i load in my init file.
I can't clone cedet over the directory in /lisp/cedet since packages like eieio or speedbar would still not get overwritten since they are in a different folder.
The temporary solution now is to delete the older packages that came bundled with emacs in order to give priority over the ones I load via my init file.
Is there a way to prioritize the load of my init file over the load of the default emacs packages?
If you use CEDET 1.0 or 1.1, the basic install instructions work fine, since many names are different. If you use CEDET from bzr trunk which uses the new naming scheme, you need to use:
(load-file "/home/user/cedet/cedet-devel-load.el")
which will perform the necessary magic to remove the built-in CEDET from the load path, and install the new CEDET onto your load path.
See the INSTALL file in CEDET bzr trunk for more.
Put the cedet repository directory at the front of your load-path and Emacs will pick it up from the cedet area...

Putting CEDET ede-cpp-root-project commands outside the .emacs file

I have a working EDE project, but I would like to locate the command in a file in the source tree for that project and not in my .emacs file. Is this possible?
I have tried using directory variables and emacs loads the file, but it does have any affect. To do this I placed the following code in .dir-locals.el in the project root:
((nil
. ((ede-cpp-root-project "MyProj"
:name "MyProj Project"
:file "/home/jlisee/projects/myproj_code/CMakeLists.txt"
:include-path '( "/packages" )
:system-include-path '( "/opt/myproj/local/include" )
:spp-table '( ("CONST" . "const") )
))))
The project type ede-cpp-root is for people who specifically want to keep the project file out of their source tree. If you want a project type in your source tree, there are other options.
If you are using a recent version of CEDET, you can instead enable the generic project types which in turn supports cmake (which it looks like you are using?)
(ede-enable-generic-projects)
Once in this generic project for CMake, use
M-x ede-customize-project RET
to add in include paths, macro tables, and the like.
If you aren't using makefiles, cmake, or whatever, you can create your own generic project type with a bit of code in your .emacs file. Look in ede-generic for everything that mentions CMake, and it should be pretty obvious what 3 things to create.
I think the existing project type uses CMakeLists, not CMakeLists.txt, so perhaps the existing code needs a tweak.

How to se the cscope database directory in emacs?

I use cscope with emacs, and it works well, but it creates cscope.out and cscope.files in the root directory.
My project is configure so that only the "/private" directory is ignored by SVN.
How can I tell cscope to put its files in "/myproject/private" rather than "/myproject"?
According to the documentation there is no such setting (or at least I cannot find it). If SVN is what concerns you can just ignore the cscope files on their own.