Can Emacs support projects? - emacs

Can Emacs support the concept of projects? That would be where several configuration options varies depending on what project you are working on.

Yes, please look to the EDE package from CEDET library

Check out the project-local-variables plugin. I haven't used it personally, but I've seen it mentioned in the Rinari-mode documentation for scoping down a find-file-in-project function.

You generally wouldn't expect emacs to know about differences in build requirements---you let the build system (make or whatever) take care of that. To handle different coding standard define local yourproject.el files to set variables, load and unload local modes, etc... (use M-x load-file to run it).

To be pedantic, Emacs can support anything, being as it's a Lisp language runtime which so happens to have an editor on top of it.
To be specific, some addons for Emacs support Projects, such as the JDEE.

Well, as you can see there are several packages to do this.
You might like this approach:
http://blog.jrock.us/articles/eproject.pod
I just read it today.

Dude, as mentioned in another answer, EMACS can do anything. That said, let's expand a little on what a "project" means in this context. In most IDE's, like Eclipse, Netbeans, Visual Studio, or Xcode, "project" means two things: a file layout for the pieces that belong together, and instructions to the build system to build the thing composed of those pieces.
In EMACS, you have complete control of these things, but how they work together is dependent on both the target environment -- Lisp, Java, C/C++ and so on. Lisp is supported by SLIME, Java by the JDEE, C/C++ by the built in modes and a bunch of conventions; version control is also built in if you want to use it.
In most cases, the build details don't really affect the editor itself much, but you can specialize the behavior for specific files using either modelines, or local variables. JDEE has a specific "project" notion built in.
What languages and environments are you trying to work with?

Related

Is there any text editor for Mac that can be configured to have, or already has, autocomplete for Lua?

I know TextWrangler shows the option, but it doesn't actually do anything. So what I want is autocomplete, either with a key combination, or while I type.
Syntax coloring/highlighting is a requirement as well, though I know Xcode and TextWrangler have that.
You might want to use Lua Development Tools for this purpose. It has syntax coloring, plus it is doing smart autocomplete, depending on what your actual context is (required modules, ...)
It is an Eclipse Technology project, and it is Open Source! (EPL license).
Project web page - http://www.eclipse.org/koneki/ldt
Installation via Eclipse Marketplace - http://marketplace.eclipse.org/content/lua-development-tools-koneki
I don't know if you have seen this page, but it seems a good place to start:
http://lua-users.org/wiki/LuaEditorSupport
If I search for "completion" I get:
Decoda (Win)
LuaEdit (Win)
DForD (Win)
NsEditor (Win)
Visual Studio + LuaLite
Eclipse + LuaEclipse or LunarEclipse (java)
I personally use Vim + SuperTab (which only auto-fills with things that you have previously written).
There's a nice plugin for IntelliJ IDEA for Lua. IntelliJ IDEA is really nice, though kind of biggish.
Aside of that there is also TextAdept which is a lot smaller, and 100% configurable in Lua.
And probably a bunch of others.
If you want full (semantic) autocompletion, you should try lua-inspect (source code), which can be installed in the SciTE editor, and also into ViM using vim-lua-inspect.
It uses Metalua to fully parse the source code into AST and then performs code analysis. Apart from simple keyword-based syntax highlighters, it can:
differentiate between local/global variables, parameters and unused variables
jump to the definition of a variable/function
autocomplete table members
correctly rename variables/functions (not only definitions but also uses)
Even though it is not yet stable, and tends to hang on large scripts, it is very usable for standard Lua programs, mainly for it's intelligent autocompletion and renaming.

Generating a list of include directories, and project files from a CMakeLists.txt

I'd like to use emacs to work on my project that is built using CMake, while this generally works fine, I'd like to implement better project management commands. Is there a simple way to generate some sort of file that acts as a listing of the project files.
It seems that the best way may just be some set of CMake macros that do a custom write to a file, is there perhaps any better solutions?
I have no direct experience with CMake. But there are a couple of approaches to solving this.
The canonical way is to generate a TAGS table as a part of your buid process. You will get symbol completion/navigation on top of easy access to file-list. And ctags is hyper fast. I'll leave you to google how to do that specifically, hint: wiki.
Alternatively, you can get a Emacs project management package like EDE, eproject, mk-project that defines the concept of a project. See wiki.
You can look onto CEDET mailing list - CMake support was discussed not so long time ago, and at least one person is actively working on CMake support in EDE (CEDET's project management)

Emacs project management for Scala

I would like to ask if any of you have any experience {and,or} could point me to a project management extension for Emacs that works well with {Scala,Ensime,SBT}. It would also be amazing if it didn't require too much hacking. I did some scheme in the past but I have little experience with the Emacs platform.
Basically, by project management I mean mainly the ability to 'tie files into project' and then search among them (and only among them).
Thanks for taking the time to read this and answer!
I really hate that you can't setup projects out of the box, though.
Just set up the project with sbt or maven and import it with ensime.
Essentially, what i would want is to be able to flex-find files in the project
"flex-find" is not English, so I don't really know what you mean. But what is wrong with find (the command line tool)?
With ensime you can load your project and then search for a type or method by name. The key sequence is C-c C-v v. This allows you to, for example, jump directly to a class definition.
The package projectile has a bunch of generic project-level features, such as running commands in the project root folder, grepping, creating TAGS files etc.
I'm a relatively new user of it, so I can't say exactly how big a difference it makes, but it seems like a worthwhile addition to your tool belt.

what are the code completetion systems available for emacs core (23.3 or 24)?

I use auto-completion mode which is not inbuilt. good but not the best IMO. So I was wondering is there inbuilt generic plugins for completion in emacs like you see in IDEs.
to name,
dabbrev
hippie expansion
I think these two are different from auto-completion mode kind which I am looking for.
EDIT:
I like to extend one of any completion system to support a scripting language which I use regularly for scientific data visualization.
There is CEDET package in GNU Emacs starting from version 23, but it slightly outdated, and it's better to use CEDET from its repository. I have an article on setting and use CEDET from repository.
Why don't you want to use external packages? With new packaging system in GNU Emacs (package.el) and with things, like el-get, it's very easy to install new packages into GNU Emacs...
CEDET's autocompletion is the only drop-down completion package provided in core Emacs. The core in-place completion packages are hippie-expand and dabbrev.
The primary non-core packages which provide drop-down completion are auto-complete and company; the former appears to be the most popular these days.
There's also anything, which is an interactive completion package. While it doesn't provide drop-down completion at the cursor position, the way it works is really rather nice, so it's worth investigating.
With a bit of tweaking, dabbrev and hippie-expand can be a lot more effective than you might expect, but if you want something more visual and interactive, my advice is to look beyond the core packages and go for auto-complete or perhaps anything.
(For what it's worth, I use both hippie-expand and auto-complete myself.)
As a C programmer I tried http://cx4a.org/software/gccsense.
I read an interview where the CEDET author said that this is actually better because it hooks directly into gcc. However its quite a hassle to install gccsense because I had to compile a modified gcc. Once this package is included in distributions I would use it.
You may also want to try out predictive mode. While not exactly a code completion package, it comes close to it by predicting your frequently used words, which in a coding platform is definitely a limited vocabulary.
http://www.dr-qubit.org/emacs.php
The emacs wiki has a good explanation too.
http://www.emacswiki.org/emacs/PredictiveMode

Eclipse Style Function Completions in Emacs for C, C++ and JAVA?

How Do I Get Eclipse Style Function Completions in Emacs for C, C++ and JAVA?
I love the power of the Emacs text editor but the lack of an "intellisense" feature
leaves me using Eclipse.
M-/ is a quick and dirty autocomplete based on the contents of your current buffer. It won't give you everything you get in Eclipse but is surprisingly powerful.
I can only answer your question as one who has not used Eclipse much. But! What if there was a really nice fast heuristic analysis of everything you typed or looked at in your emacs buffers, and you got smart completion over all that everywhere, not just in code?
M-x load-library completion
M-x global-set-key C-RET complete RET
When I was doing java development I used to use the:
Java Development Environment for Emacs (JDEE)
The JDEE will provide method name completion when you explicitly invoke a jdee provided function. It has a keyboard binding for this functionality in the jdee-mode.
The CEDET package provides completion for C/C++ & Java (and for some other languages). To initial customization you can take my config that i use to work with C++ projects
Right now, I'm using Auto Complete for Emacs. As a current Visual Studio and ex-Eclipse user, I can say that it rivals both applications quite well. It's still not as good as Microsoft's IntelliSense for C#, but some would say that C++ is notoriously difficult to parse.
It leverages the power of (I believe) the Semantic package from Cedet, and I find it feels nicer to use when compared to Smart Complete. It completes C++ members, local variables, etc. It's pretty good. However, it falls down on not being able to complete overloaded methods (it only shows the function once with no parameters, but thats a limitation of Cedet I believe), and other various things. It may improve in future though!
By the way, I could be wrong here, but I think you need an EDE project set up for the class member completion to work (just like you would normally with Semantic). I've only ever used it while having an EDE project, so I assume this is true.
Searching the web I find http://www.emacswiki.org/cgi-bin/wiki/EmacsTags#toc7 describing complete-tab in etags. It is bound to M-Tab by default. This binding may be a problem for you
Also, etags has some limits, which may annoy you...
The link also points to CEDET as having better symbol completion support.
Have you tried the emacs plugin for eclipse?
http://people.csail.mit.edu/adonovan/hacks/eclipse-emacs.html
I've written a C++-specific package on top of CEDET that might provide
what you want. It provides an Eclipse-like function arguments hint.
Overloaded functions are supported both for function arguments hint
and for completion.
Package is located here:
https://github.com/abo-abo/function-args
Make sure to check out the nice screenshot:
https://raw.github.com/abo-abo/function-args/master/doc/screenshot-1.png
auto-complete-clang is what you want. Can't go wrong with using an actual C++ compiler for completions.
The only problem it has is there's no way to know what -I and -D flags to pass to the compiler. There are packages for emacs that let you declare projects and then you can use that.
Personally, I use CMake for all C and C++ work so I wrote some CMake code to pass that information to emacs through directory-local variables. It works, but I'm thinking of writing a package that calls cmake from emacs so there's less intrusion.