Merge from trunk.
[bpt/emacs.git] / lisp / cedet / semantic / chart.el
index 124227d..1c08cb0 100644 (file)
@@ -1,7 +1,7 @@
 ;;; semantic/chart.el --- Utilities for use with semantic tag tables
 
-;;; Copyright (C) 1999, 2000, 2001, 2003, 2005, 2008, 2009
-;;; Free Software Foundation, Inc.
+;; Copyright (C) 1999-2001, 2003, 2005, 2008-2011
+;;   Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
 ;; the output of the semantic parser.
 ;;
 
-(require 'chart)
 (require 'semantic)
-(require 'semantic/find)
-(require 'semantic/db-mode)
-(require 'semantic/db-typecache)
-(require 'semantic/scope)
+(require 'chart)
+(require 'semantic/db)
+(require 'semantic/tag)
+
+(eval-when-compile (require 'semantic/find))
 
 ;;; Code:
 
@@ -40,7 +40,7 @@
 Each bar represents how many toplevel tags in TAGTABLE
 exist with a given class.  See `semantic-symbol->name-assoc-list'
 for tokens which will be charted.
-TAGTABLE is passedto `semantic-something-to-tag-table'."
+TAGTABLE is passed to `semantic-something-to-tag-table'."
   (interactive)
   (let* ((stream (semantic-something-to-tag-table
                  (or tagtable (current-buffer))))
@@ -64,9 +64,9 @@ Each bar represents how many toplevel tags in TAGTABLE
 exist in each database entry.
 TAGTABLE is passed to `semantic-something-to-tag-table'."
   (interactive)
-  (if (or (not (fboundp 'semanticdb-minor-mode-p))
-         (not (semanticdb-minor-mode-p)))
-      (error "Semanticdb is not enabled"))
+  (unless (and (fboundp 'semanticdb-minor-mode-p)
+              (semanticdb-minor-mode-p))
+    (error "Semanticdb is not enabled"))
   (let* ((db semanticdb-current-database)
         (dbt (semanticdb-get-database-tables db))
         (names (mapcar 'car
@@ -108,7 +108,7 @@ TAGTABLE is passed to `semantic-something-to-tag-table'."
   "Create a bar chart representing the complexity of some tags.
 Complexity is calculated for tags of CLASS.  Each bar represents
 the complexity of some tag in TAGTABLE.  Only the most complex
-items are charted.  TAGTABLE is passedto
+items are charted.  TAGTABLE is passed to
 `semantic-something-to-tag-table'."
   (interactive)
   (let* ((sym (if (not class) 'function))
@@ -143,9 +143,14 @@ items are charted.  TAGTABLE is passedto
                       nums "Complexity (Lines of code)")
     ))
 
+(declare-function semanticdb-get-typecache "semantic/db-typecache")
+(declare-function semantic-calculate-scope "semantic/scope")
+
 (defun semantic-chart-analyzer ()
   "Chart the extent of the context analysis."
   (interactive)
+  (require 'semantic/db-typecache)
+  (require 'semantic/scope)
   (let* ((p (semanticdb-find-translate-path nil nil))
         (plen (length p))
         (tab semanticdb-current-table)
@@ -164,8 +169,6 @@ items are charted.  TAGTABLE is passedto
                       "Number of tags")
     ))
 
-
-
 (provide 'semantic/chart)
 
 ;;; semantic/chart.el ends here