Emacs doxy-graph minor mode
doxy-graph-mode
links source code to doxygen call graphs.
It allows to interactively see the call graph or the inverted call graph of a given function or method from source code.
Requirements
- emacs 26.3 (or newer).
- doxygen 1.8.13 (or newer).
Usage
Firts of all you have to generate doxygen latex documentation
including call graphs. To carry out this you can generate a Doxyfile
config file with the command doxygen -g
in your source code path.
It is necessary to change the following settings inside Doxyfile
.
CALL_GRAPH = YES
CALLER_GRAPH = YES
An example of Doxyfile
is given in this repository.
You can invoque doxy-graph-mode
commad M x doxy-graph-mode
.
When mini mode is active you can position the cursor over function name and visualize call graph and inverted call graph.
Default keybindings are:
<C-f1>
Opens direct call graph.<C-f2>
Opens inverted call graph.
First time is called doxy-graph-open-call-graph
or
doxy-graph-open-inverted-call-graph
it is asked for select doxygen
latex folder. You can choose doxygen latex folder using the directory
chooser.
Calling the interactive function doxy-graph-set-latex-path
you can
change the folder where doxygen latex docs are placed.
If you wish you can change default keybindings using
doxy-graph-mode-map
. The following example binds C c c
and C c i
like default shortcuts.
(define-key doxy-graph-mode-map (kbd "C-c c") 'doxy-graph-open-call-graph)
(define-key doxy-graph-mode-map (kbd "C-c i") 'doxy-graph-open-inverted-call-graph)
By default doxy-graph-mode
is setting up for c
and c++
languages
with their hook. If you want to start doxy-graph-mode
automatically
for your favorite language you have to add doxy-graph-mode
the
corresponding language hook. For example the following code setup the
hook for python
programming in you .emacs
file.
(add-hook 'python-mode-hook 'doxy-graph-mode)