From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrea Crotti Newsgroups: gmane.emacs.help Subject: Re: Code to caller graph Date: Wed, 15 Dec 2010 17:51:38 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1292431956 4684 80.91.229.12 (15 Dec 2010 16:52:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Dec 2010 16:52:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 15 17:52:32 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PSuad-0006rp-Jk for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Dec 2010 17:52:31 +0100 Original-Received: from localhost ([127.0.0.1]:48951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSuad-00058K-5g for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Dec 2010 11:52:31 -0500 Original-Received: from [140.186.70.92] (port=39220 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSua1-000565-Dc for help-gnu-emacs@gnu.org; Wed, 15 Dec 2010 11:51:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSua0-0007Ct-BI for help-gnu-emacs@gnu.org; Wed, 15 Dec 2010 11:51:53 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:41452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSua0-0007CN-1A for help-gnu-emacs@gnu.org; Wed, 15 Dec 2010 11:51:52 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PSuZy-0006OL-Nz for help-gnu-emacs@gnu.org; Wed, 15 Dec 2010 17:51:50 +0100 Original-Received: from 85-124.eduroam.rwth-aachen.de ([134.61.85.124]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Dec 2010 17:51:50 +0100 Original-Received: from andrea.crotti.0 by 85-124.eduroam.rwth-aachen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Dec 2010 17:51:50 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 85-124.eduroam.rwth-aachen.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:SH8huFOO2f7fEhq46lGZ0CptbHc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77557 Archived-At: Andrea Crotti 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...