From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marc Tfardy Newsgroups: gmane.emacs.help Subject: Tool for ELISP code analysis Date: Mon, 05 Mar 2007 13:21:11 +0100 Message-ID: <552g9pF235gcoU1@mid.individual.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1173098471 16243 80.91.229.12 (5 Mar 2007 12:41:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 5 Mar 2007 12:41:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 05 13:41:03 2007 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.50) id 1HOCUw-0000PA-H1 for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Mar 2007 13:41:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOCUw-0001A4-2N for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Mar 2007 07:41:02 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 94 Original-X-Trace: individual.net w0te8APOFXVVsDdzZlC7yQ97iygMQJv8s+H8qQO5sBB2bcwqZ7 User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) Original-Xref: shelby.stanford.edu gnu.emacs.help:146073 comp.emacs:93970 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:41677 Archived-At: Hi! I try to understand some (complicated) ELISP code with many lines of code and many functions. It is not easy to keep overview of the function calls and dependecies between functions/variables. Is there maybe a Emacs tool for ELISP code analysis? It should idicate all disired functions and variables (specified with regexp, like e.g. "bla-*") with list of all function/variables called/referenced from this function. Some example - assume we have following code: -file: bla.el----------------------------------------------------------- (defvar bla-max-iter 100) (defun bla-foo () (let ((i 0)) (while (< i bla-max-iter) (bla-big-job i) (incf i))) (defun bla-goo (text) (message "[BLA] %s" text)) (defun bla-big-job (num) (unimportant-code) (more-unimportant-code) (bla-do-nothing) (bla-do-something)) (defun bla-do-nothing () (long-unimportant-code) (setq bla-min 0) (setq bla-max 10)) (defun bla-do-something () (strange-code) (bla-antoher-fun 1 2 3 4) (bla-secret-fun 0)) (defun bla-another-fun (v1 v2 v3 v4) (+ v1 v2 v3 v4)) (defun bla-secret-fun (n) (message "MAGIC!")) -file: bla.el ends here------------------------------------------------- Now we start analyse tool for whole code in buffer bla.el. We look only for bla-stuff: M-x elisp-analyse RET bla-* and we should get something like this: VAR: bla-max-iter FUN: bla-foo: --> bla-max-iter (VAR) --> bla-big-job (FUN) FUN: bla-goo: FUN: bla-big-job: --> bla-do-nothing (FUN) --> bla-do-something (FUN) FUN: bla-do-nothing: --> bla-min (VAR) --> bla-max (VAR) FUN: bla-do-something: --> bla-antoher-fun (FUN) --> bla-secret-fun (FUN) FUN: bla-another-fun: FUN: bla-secret-fun: Note: we get *ONLY* functions and variables with "bla-"-Prefix, due to elisp-analyse call with bla-*. The function and variable names in this list could be linked to definitions in bla.el, so a click with mouse or RET on such a name jumps directly to properly line (in other window with bla.el). Does exists already such a tool? regards Marc