0

I've recently started using EDE (via CEDET via ECB) in an attempt to get Emacs set up as a reasonable IDE for development on a largish C/C++/Python project.

Something that was a bit fiddly to get set up (as I'm an Emacs and Lisp novice) was rapid file finding. The solution I currently have is to set up a raw/blank project (one EDE doesn't need to know how to manage makefiles or builds for) like so in my .emacs file:

;; Enable EDE mode
(global-ede-mode 1)
;; EDE knows nothing of my project type, so use CSCope to inform it of the project
;; and its files
(setq ede-locate-setup-options
    '(ede-locate-cscope
      ede-locate-base))
;; This is probably a dubious shortcut allocation, 
;; but it's what I'm using at the mo.
(global-set-key (kbd "C-f") 'ede-find-file)
;; Set up the project for EDE
(ede-cpp-root-project "LargeApp" :file "/workspace/me/LargeApp/SConstruct")

M-x ede-find-file used to not work at all, because EDE didn't know anything of the files in the project directory and sub-directories. Setting up the files in an EDE project would have taken ages (10000+ files), but luckily EDE understands CSCope output, so it was a matter of doing this in my project root directory using a little bash script (based on information linked from the main CScope project page):

   #! /usr/bin/env bash

   cd /workspace/me/LargeApp
   find /workspace/me/LargeApp \
        -type d -name '.git*' -prune -o \
        -type d -name '.svn*' -prune -o \
        -type d -name 'build' -prune -o \
        -type d -name 'bin' -prune -o \
        -type d -name 'lib' -prune -o \
        -name '*.h' -print -o \
        -name '*.hpp' -print -o \
        -name '*.c' -print -o \
        -name '*.cpp' -print -o \
        -name '*.cc' -print -o \
        -name '*.py' -print -o \
        -name '*.lua' -print -o \
        -name '*.xml' -print >./cscope.files
    cscope -b -q -k

EDE then picks up the cscope.out in the project root folder, and kazam!, M-x ede-find-file works.

However, there are one major niggle I'm struggling to sort out:

I need to type the full, case sensitive file name.

This is less than ideal on a project this size, because you often only remember part of the filename, and not necessarily the case. It would be great if I could get it set up so I only have to type a case-insensitive substring of the filename, and then get an IDO buffer or similar I can tab through until I get the file I'm looking for.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Rob
  • 1,350
  • 12
  • 21
  • 1
    Do you know about projectile ? https://github.com/bbatsov/projectile It is also based on GNU find to interactively find files in your project (defined by a VCS or a .projectile). I pretty like `helm-projectile` too. I don't understand the benefit of using EDE (which I don't know) and cscope for finding files. – Ehvince May 30 '14 at 09:22
  • @Ehvince - I've heard of projectile & helm, but haven't had the chance to try them out yet. Thanks for the tips! – Rob May 30 '14 at 09:48

1 Answers1

0

I've resorted to using M-x cscope-find-this-file instead. It forces me to choose from likely filepath options in a buffer, but it does a reasonable job of getting me the right file quickly and isn't hampered by case-sensitivity. If I can get this hooked up into IDO, then it should do exactly what I want.

For Python, CScope/xcscope.el is good, but not perfect for navigating Python tags. So I've started using Elpy. M-x elpy-goto-definition works very well for Python files, and for the rest (C/C++) I'm using M-x cscope-find-this-symbol.

Rob
  • 1,350
  • 12
  • 21