User file hierarchy in emacs

I read a lot of questions about project management in emacs, although they don't seem to understand how I like to work (which goes back to the days of Borland).

Basically, I would like to create my own file hierarchy from which I can open files for editing. This will differ from the directory structure: often there are files that logically come together from the point of view of editing, but are not in the same directory, etc.

I am currently working with scitepm , which is a launcher for the SciTE editor (Scintilla derivative). But it seems to me that emacs should be able to do something similar - I just cannot separate my specific use case from the various descriptions of eproject, speedbar, etc.

Any pointers? Or is my hopelessly retro workflow?

+4
source share
3 answers

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

  • (emacs) Filesets : (emacs) Filesets --- see (emacs) Filesets .

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

  • TAGS files give you direct or search access to โ€œdefinitionsโ€ in a given set of files. A definition can be anything, in principle, but usually it is a definition of a function, variable, class, etc. (IOW, programming constructors).

Bookmark + offers a few more features that can help (bookmarks usually repeat):

  • Dired bookmarks: any set of files and subdirectories along with inserted subdirectories, a set of Dired markings, hidden inserted subdirectories and "skipped" files and subdirectories.

  • Bookmarks in Autofile: Bookmark any file without even visiting it.

  • Tagging tags: categorize your bookmarks in any way. Tags define sets of bookmarks. Sort by tags, search by tags, ...

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

  • Desktop bookmarks: Emacs session states --- return sets of files, regardless of what was in the new session.

  • Composite or bookmark sequences combine the effect of multiple bookmarks.

Icicles offers other features that may help:

Here is a good entry point to project support: Icicles - Project support .

  • This allows you to easily save and restore sets of file names aggressively (or just a session). This includes a set of emacs files, as well as more flexible sets of files and directories. You can protect against a saved set of file names when using Cx Cf , etc. File names stored in the collection can be located anywhere on your file system (or remote).

  • improves Bookmark + functions in various ways.

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

  • improves the use of Dired in various ways.

  • It provides functions for searching through a set of files or buffers, including a constant set.

+5
source

Take a look at www.emacswiki.org/emacs/BookmarkPlus. He had a lot of options and settings. What may be interesting for you is that you can have several bookmark files, each of which stores several bookmarks, and then one or more master bookmark files that store them, except for ordinary bookmarks ... you get the point :)

I mainly use bookmark + because it allows you to associate functions with bookmarks as well.

+1
source

When I work on improving one core language, I tried several approaches for creating projects / file groups. What I stopped was not mentioned yet, so I will say a few words about it. He is EDE . It comes with CEDET, but it's actually a separate thing. He has some ready-made project templates, especially for Emacs Lisp, C, and I think that in the end I saw a setting for developing Android Java.

This differs from other solutions in that you will need to write Emacs Lisp code to configure it to do what you like. On the other hand, it already has many library functions. For example: it has centralized project management, a way to configure serialization / deserialization, APIs that can be accessed through the menu, an API for changing project parameters using widgets. It uses a general, very clean approach to solving this in terms of how it is programmed.

The following is a non-polished version of the code, but may give you an idea of โ€‹โ€‹how it might look: http://code.google.com/p/haxe-mode/source/browse/trunk/lisp/ede/haxe.el

0
source

Source: https://habr.com/ru/post/1497477/


All Articles