Skip to content
Matthew O. Smith edited this page Feb 13, 2014 · 2 revisions

Many IDEs come with the notion of a workspace which is a collection of projects that are, in the mind of the developer, related to each other. Not all code that goes into the final product is contained in a single project. Indeed, many libraries can be used to create the final artifact.

This page will discuss how the same thing may be done for java projects using malabar-mode. Not all the ideas presented here will require malabar-mode, but they will all work within that context.

Using TAGS

EMACS has a built-in facility called tags which allows a developer to quickly jump to a class or method. It requires a TAGS file be created using the etags program that does a good job with Java.

It is common to put all related projects in a common directory. If so, then create a TAGS file in each project, adding it to the ignore file of your source control. By adding the following, assuming your projects are subdirectories of ~/workspace, you can then use tags to jump directly to code in another project.

(defun add-to-tags-table-list (dir)
  (interactive "DDirectory:")
  (if (file-exists-p dir)
    (dolist (file (directory-files dir t))
      (if (file-exists-p (expand-file-name (concat file "/TAGS")))
	  (add-to-list 'tags-table-list file)))))

(add-to-tags-table-list "~/workspace")

Putting it all together

Clone this wiki locally