Replies: 3 comments
-
|
I forgot to add "speedbar" to the list of the elisp libraries. |
Beta Was this translation helpful? Give feedback.
-
|
It looks doable, but maybe we should ask in the first place: what's a good way to explore an unfamiliar codebase?
This will help, but to me the "visualization" does not necessarily mean a directory tree. I don't even think this is useful for most C/C++ project given their conventional flat directory structure (maybe I am wrong). Instead, a visualization of logical relationships between entities, like A references B, A implements/inherits B, may be more useful. These kinds of relationships naturally form a graph, which is easier to visualize in a GUI than in Emacs. Some examples:
Based on the goodies that ctags already offers (the so called dependency reference tags, which I believe is usable for many languages by now), we can focus on relationships between modules (or headers, files). A tool like org-roam-server will fit this, but that would require a dedicated GUI tool, or a Emacs plugin that serves such a GUI in a web browser, which to me is acceptable, but not very aesthetic to people who want to live in Emacs. However, visualizing a graph in a text-based tool may be a serious challenge, and I haven't seen any example of this. Some of my ideas:
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the great input. I have implemented a small tool that I want to use today. Screencast.From.2025-04-21.02-44-10.mp4I used the word |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I'm reading a software written in Ruby on Rails. I'm not familiar with the framework and Ruby.
Just reading source files is insufficient and inefficient in understanding the target software.
The definitions of modules and classes are widely spread throughout the source tree. Reading source files wastes time unless you know the framework's conventions. Ruby on Rails is so popular.
Getting such knowledge may not be hard. But if I have to understand the target software based on a private and/or minor framework, what will happen?
I need to understand the source tree. I have thought about improving ctags/readtags and citre in this direction.
In ctags, I'm trying to add
FileSystem(pseudo) parser. The parser has "file" and "dir" kinds. The parser extracts the names of files even if ctags has no suitable parser for the files.With
initForeignTagEntryfunction, a prototypeTreeparser emits the file and dir tags.Ctags may be able to reproduce the source tree structure.
I hope to do something interesting with this feature.
I'm also exploring my idea on Citre's side.
When you press M-. on
"header", citre brings you to a buffer which opens theheader.Do I want this behavior if I'm unfamiliar with the target software?
It would be nice if Citre could bring me to a buffer visualization where the
headeris in the source tree. To evaluate my idea, I wrotexref-dir-location. If a tag's language isFileSystemor the kind of tag isfile,Citre makes a xref withxref-dir-locationinstead ofxref-file-location.Screencast.From.2025-04-19.03-36-23.mp4
The default handler of the current implementation utilizes dried.
From the dried buffer, it is hard to feel the structure of the source tree, though it is better than finding the file.
However, the function for making the marker is customizable.
These days, tree-oriented elisp libraries are available:
https://github.com/emacsorphanage/direx
https://github.com/tilmanrassy/emacs-dir-treeview
https://github.com/Alexander-Miller/treemacs
https://codeberg.org/fourier/ztree
Jumping to an entry in the source tree looks like an interesting feature.
Beta Was this translation helpful? Give feedback.
All reactions