Domanda

I've read many questions about project-management in emacs, though they don't seem to be getting at how I like to work (which dates back to Borland days).

Basically, I'd like to create my own hierarchy of files from which I can open files for editing. This would be distinct from the directory structure : Often there are files that make logical sense to be collected together from an editing point of view, but are not in the same directory, etc.

At the moment, I've been working with scitepm, which is a side-bar launcher for the editor SciTE (a Scintilla derivative). But it seems to me that emacs must be able to do something similar - I just can't tease out my specific use-case from the various descriptions of eproject, speedbar, etc...

Any pointers? Or is my workflow hopelessly retro?

È stato utile?

Soluzione

Vanilla Emacs, out of the box, offers some features that can help:

  • Filesets: persistent sets of files --- see (emacs) Filesets.

  • Dired can be opened on an explicit set of files, regardless of what directories they are in. Just pass a list of absolute file names as the DIRNAME argument to command dired.

  • TAGS files give you direct or searchable access to "definitions" in a given set of files. A definition can be anything, in principle, but it is typically a function, variable, class, etc. definition (IOW, programming constructs).

Bookmark+ offers some more features that can help (bookmarks are typically peristent):

  • Dired bookmarks: Any set of files and subdirectories, together with the inserted subdirectories, set of Dired markings, hidden inserted subdirectories, and "omitted" files and subdirs.

  • Autofile bookmarks: Bookmark any file without even visiting it.

  • Bookmark tagging: Categorize bookmarks any ways you like. Tags define sets of bookmarks. Sort by tags, search wrt tags,...

  • Multiple bookmark files: Another way to define sets of bookmarks.

  • Desktop bookmarks: Emacs session states --- bring back filesets, whatever in a new session.

  • Composite, or sequence bookmarks combine the effect of multiple bookmarks.

Icicles offers other features that can help:

Here is a good entry point to its support for projects: Icicles - Support for Projects.

  • It lets you easily save and restore sets of file names persistently (or session only). This includes emacs filesets but also more flexible sets of files and directories. You can complete against a saved set of file names when you use C-x C-f etc. The file names saved in a collection can be anywhere on your file system (or remote).

  • It enhances the Bookmark+ features in various ways.

  • It enhances the use of Emacs TAGS files and code navigation.

  • It enhances the use of Dired in various ways.

  • It provides features for searching across a set of files or buffers, including a persistent set.

Altri suggerimenti

Have a look at www.emacswiki.org/emacs/BookmarkPlus. It's got a lot of options and customization. What might be interesting for you is that you can have multiple bookmark files, each storing multiple bookmarks, and then one or more master bookmark files that stores them, besides the normal bookmarks... you get the point:)

I'm mainly using bookmark+ because it allows to bind functions to bookmarks as well.

As I'm working on improving one major language mode, I tried several approaches to creating projects / groups of files. The thing that I settled upon hasn't been mentioned here yet, so I'll say a couple of words about it. It's EDE. It comes with CEDET, but really is a separate thing. It has several ready-made project templates, specifically for Emacs Lisp, C and I think I, eventually, saw a customization for Android Java development.

This is different from other solutions in that you would need to write some Emacs Lisp code to customize it to do what you like. On the other side, it has many library functions already in place. Such as: it has centralized project management, way to serialize/deserialize settings, APIs to be accessed through menu, API for modifying project settings by means of widgets. It uses overall a very clean approach to solving this in terms of how it is programmed.

Below isn't a polished version of the code, but might give you an idea of what it may look like: http://code.google.com/p/haxe-mode/source/browse/trunk/lisp/ede/haxe.el

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top