diff lisp/cedet/data-debug.el @ 104489:25e047f7f6a2

Synch to Eric Ludlam's upstream CEDET repository. * cedet/semantic/wisent/java-tags.el: * cedet/semantic/wisent/javat-wy.el: New files. * cedet/semantic/wisent/java.el: * cedet/semantic/wisent/java-wy.el: Files removed. * cedet/semantic/java.el (semantic-java-prototype-function) (semantic-java-prototype-variable, semantic-java-prototype-type): Doc fix (java-mode::semantic-format-tag-prototype): Renamed from semantic-format-prototype-tag, which didn't match the overloadable function. * cedet/semantic/bovine/c.el (semantic-c-dereference-namespace-alias): Deal correctly with nested namespaces. Make sure type actually exists in original namespace. * cedet/semantic/lex-spp.el (semantic-lex-spp-hack-depth): New. (semantic-lex-spp-lex-text-string): Use above to enable recursion. * cedet/semantic/format.el: Whitespace cleanup. (semantic-test-all-format-tag-functions): Move to end. (semantic-format-tag-prototype, semantic-format-tag-name) (semantic-format-tag-name-default): Revert to original upstream positions. * cedet/semantic/elp.el: File removed. * cedet/semantic/analyze.el (semantic-adebug-analyze): New function, moved here from semantic/adebug. * cedet/semantic/adebug.el: Declare external semanticdb functions. (semantic-adebug-analyze, semantic-adebug-edebug-expr): Deleted. * emacs-lisp/eieio.el (eieio-unbound): Default value is now robust to recompile. * emacs-lisp/eieio-datadebug.el: Add eieio objects to the list of data debug things to recognize. * emacs-lisp/eieio-comp.el: Synch to upstream. * cedet/data-debug.el: Don't require eieio and semantic/tag. If eieio is loaded, require eieio-datadebug. (data-debug-insert-ring-button): Do not be specific about the ring contents. (data-debug-thing-alist): Remove eieio and semantic specific entries. (data-debug-add-specialized-thing): New function. * cedet/cedet.el: Update commentary. * cedet/cedet-edebug.el: Require edebug and debug.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 13 Sep 2009 15:58:30 +0000
parents 6ccad1511df1
children
line wrap: on
line diff
--- a/lisp/cedet/data-debug.el	Fri Sep 11 01:17:46 2009 +0000
+++ b/lisp/cedet/data-debug.el	Sun Sep 13 15:58:30 2009 +0000
@@ -43,9 +43,6 @@
 
 (require 'font-lock)
 (require 'ring)
-(require 'eieio)
-(eval-when-compile
-  (require 'semantic/tag))
 
 ;;; Code:
 
@@ -384,18 +381,9 @@
 		      (ring-size ring)))
 	 (ringthing
 	  (if (= (ring-length ring) 0) nil (ring-ref ring 0)))
-	 (tip (format "Ring max-size %d, length %d.  Full of: %S"
+	 (tip (format "Ring max-size %d, length %d."
 		      (ring-size ring)
-		      (ring-length ring)
-		      (cond ((stringp ringthing)
-			     "strings")
-			    ((semantic-tag-p ringthing)
-			     "tags")
-			    ((eieio-object-p ringthing)
-			     "eieio objects")
-			    ((listp ringthing)
-			     "List of somethin'")
-			    (t "stuff"))))
+		      (ring-length ring)))
 	 )
     (insert prefix prebuttontext str)
     (setq end (point))
@@ -763,25 +751,6 @@
     ;; nil
     (null . data-debug-insert-nil)
 
-    ;; eieio object
-    ((lambda (thing) (object-p thing)) . data-debug-insert-object-button)
-
-    ;; tag
-    (semantic-tag-p . data-debug-insert-tag)
-
-    ;; taglist
-    ((lambda (thing) (and (listp thing) (semantic-tag-p (car thing)))) .
-     data-debug-insert-tag-list-button)
-
-    ;; find results
-    (semanticdb-find-results-p . data-debug-insert-find-results-button)
-
-    ;; Elt of a find-results
-    ((lambda (thing) (and (listp thing)
-			  (semanticdb-abstract-table-child-p (car thing))
-			  (semantic-tag-p (cdr thing)))) .
-			  data-debug-insert-db-and-tag-button)
-
     ;; Overlay
     (data-debug-overlay-p . data-debug-insert-overlay-button)
 
@@ -829,6 +798,22 @@
     )
   "Alist of methods used to insert things into an Ddebug buffer.")
 
+;; An augmentation function for the thing alist.
+(defun data-debug-add-specialized-thing (predicate fcn)
+  "Add a new specialized thing to display with data-debug.
+PREDICATE is a function that returns t if a thing is this new type.
+FCN is a function that will display stuff in the data debug buffer."
+  (let ((entry (cons predicate fcn))
+	;; Specialized entries show up AFTER nil,
+	;; but before listp, vectorp, symbolp, and
+	;; other general things.  Splice it into
+	;; the beginning.
+	(first (nthcdr 0 data-debug-thing-alist))
+	(second (nthcdr 1 data-debug-thing-alist))
+      )
+  (when (not (member entry data-debug-thing-alist))
+    (setcdr first (cons entry second)))))
+
 ;; uber insert method
 (defun data-debug-insert-thing (thing prefix prebuttontext &optional parent)
   "Insert THING with PREFIX.
@@ -853,7 +838,7 @@
 ;;; MAJOR MODE
 ;;
 ;; The Ddebug major mode provides an interactive space to explore
-;; the current state of semantic's parsing and analysis
+;; complicated data structures.
 ;;
 (defgroup data-debug nil
   "data-debug group."
@@ -1044,7 +1029,7 @@
 
 ;;; DEBUG COMMANDS
 ;;
-;; Various commands to output aspects of the current semantic environment.
+;; Various commands for displaying complex data structures.
 
 (defun data-debug-edebug-expr (expr)
   "Dump out the contets of some expression EXPR in edebug with ddebug."
@@ -1092,7 +1077,9 @@
       (let ((str (eval-expression-print-format (car values))))
 	(if str (princ str t))))))
 
-
 (provide 'data-debug)
 
+(if (featurep 'eieio)
+    (require 'eieio-datadebug))
+
 ;;; data-debug.el ends here