help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code to caller graph


From: Elena
Subject: Re: Code to caller graph
Date: Wed, 15 Dec 2010 14:42:20 -0800 (PST)
User-agent: G2/1.0

On Dec 15, 5:51 pm, Andrea Crotti <andrea.crott...@gmail.com> wrote:
> Andrea Crotti <andrea.crott...@gmail.com> writes:
> > I have a C++ project with a lot of intricated C++ code, and sometimes
> > it's very useful to look in the doxygen generated pages.
>
> > It would be really great if in one key combination I could jump from the
> > function definition in emacs to the image showing the call/caller graph.
>
> > I see though that the full addresses of the image graphsin doxygen is
> > something complicated like this:
>
> > doc/html/class_pad_node_a6b918365cac3efcf5201c01ffa654c21_cgraph.png
>
> > Anyone did it or has any ideas?
>
> Well if someone is interested
>
> --8<---------------cut here---------------start------------->8---
> (defun un-camelcase-string (s &optional sep start)
>   "Convert CamelCase string S to lower case with word separator SEP.
>     Default for SEP is a hyphen \"-\".
>     If third argument START is non-nil, convert words after that
>     index in STRING."
>   (let ((case-fold-search nil))
>     (while (string-match "[A-Z]" s (or start 1))
>       (setq s (replace-match (concat (or sep "-")
>                                      (downcase (match-string 0 s)))
>                              t nil s)))
>     (downcase s)))
>
> (defun doxy-path (basepath classname)
>   (concat basepath "doc/html/class_" (un-camelcase-string classname "_") 
> ".html"))
>
> (defun jump-to-doxygen-doc (basepath)
>   "jump to the corresponding doxygen page"
>   (interactive "D")
>   (let*
>       ((nondir (file-name-nondirectory (buffer-file-name)))
>        (classname (nth 0 (split-string nondir "\\."))))
>     (browse-url (doxy-path basepath classname))))
> --8<---------------cut here---------------end--------------->8---
>
> it works fine for me, given that the class name is the same of the file
> name.
>
> doxygen also uncamelise names, so PadCoordinate.cpp doc will be in
> pad_coordinate.html
> for example.
>
> I can't see the graph directly in emacs but to have the right page pop
> up is already quite nice...

What about the hash part:

> doc/html/class_pad_node_***a6b918365cac3efcf5201c01ffa654c21***_cgraph.png

?

Maybe, since the address of the HTML page  is guessable, he could
parse such page looking for the PNG image.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]