Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing a dired interface in emacs for something other than the filesystem?

The ROOT data analysis framework commonly used in high energy physics uses a binary file format that has internal structure like a real filesystem (i.e. folder & files). The ls() method output from the program look something like this:

  KEY: TH1D     name1
  KEY: TH1D     name2
  KEY: TH2D     name3
....

Where "TH1D" and "TH2D" etc. are just object type. It'd be so nice to browse the file in a dired-like interface in emacs. I certainly don't have the energy/time to write a dired interface for this from scratch (even with the help of the dired.el source). My question is: if possible, how can I just tape into the dired interface by re-implementing some functions to make a dired-like interface for the output like above?

I'm certainly not expecting a full-solution here, but rather pointers to examples, tutorial, and other useful info.

like image 664
polyglot Avatar asked Jun 26 '09 21:06

polyglot


People also ask

How do you use Dired?

You can start Dired Mode with C-x d , which will then prompt you to enter the directory you wish to view. You can also enter Dired with C-x C-f and then typing the directory you wish to view (as opposed to entering a filename). Dired Mode is a read-only buffer, so many of the commands are single letter keystrokes.

How do you create a new file in Dired?

Typing "c" in dired mode will prompt you creating new untitled file. Then press enter will create new untitled file.

How do I navigate to a folder in Emacs?

In Emacs, type M-x dired. You will be prompted for the directory to open. Type in the directory to display, or press Return to open the default directory.


2 Answers

archive-mode or tar-mode might be good starting points.

like image 73
legoscia Avatar answered Nov 15 '22 05:11

legoscia


If it's similar enough to a filesystem, perhaps you could write somekind of loopback driver taht actually allows you to mount the datafile as a filesystem, similar to the way you can mount an ISO image as a filesystem. My very limited understanding is that this isn't a terribly hard thing to do under Linux.

like image 44
rmeador Avatar answered Nov 15 '22 05:11

rmeador