Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
104488:7042156f9f43 | 104489:25e047f7f6a2 |
---|---|
41 ;; (data-debug-show-stuff stuff "myStuff")) | 41 ;; (data-debug-show-stuff stuff "myStuff")) |
42 ;; stuff)) | 42 ;; stuff)) |
43 | 43 |
44 (require 'font-lock) | 44 (require 'font-lock) |
45 (require 'ring) | 45 (require 'ring) |
46 (require 'eieio) | |
47 (eval-when-compile | |
48 (require 'semantic/tag)) | |
49 | 46 |
50 ;;; Code: | 47 ;;; Code: |
51 | 48 |
52 ;;; Compatibility | 49 ;;; Compatibility |
53 ;; | 50 ;; |
382 (str (format "#<RING: %d, %d max>" | 379 (str (format "#<RING: %d, %d max>" |
383 (ring-length ring) | 380 (ring-length ring) |
384 (ring-size ring))) | 381 (ring-size ring))) |
385 (ringthing | 382 (ringthing |
386 (if (= (ring-length ring) 0) nil (ring-ref ring 0))) | 383 (if (= (ring-length ring) 0) nil (ring-ref ring 0))) |
387 (tip (format "Ring max-size %d, length %d. Full of: %S" | 384 (tip (format "Ring max-size %d, length %d." |
388 (ring-size ring) | 385 (ring-size ring) |
389 (ring-length ring) | 386 (ring-length ring))) |
390 (cond ((stringp ringthing) | |
391 "strings") | |
392 ((semantic-tag-p ringthing) | |
393 "tags") | |
394 ((eieio-object-p ringthing) | |
395 "eieio objects") | |
396 ((listp ringthing) | |
397 "List of somethin'") | |
398 (t "stuff")))) | |
399 ) | 387 ) |
400 (insert prefix prebuttontext str) | 388 (insert prefix prebuttontext str) |
401 (setq end (point)) | 389 (setq end (point)) |
402 (put-text-property (- end (length str)) end 'face 'font-lock-type-face) | 390 (put-text-property (- end (length str)) end 'face 'font-lock-type-face) |
403 (put-text-property start end 'ddebug ring) | 391 (put-text-property start end 'ddebug ring) |
761 (defvar data-debug-thing-alist | 749 (defvar data-debug-thing-alist |
762 '( | 750 '( |
763 ;; nil | 751 ;; nil |
764 (null . data-debug-insert-nil) | 752 (null . data-debug-insert-nil) |
765 | 753 |
766 ;; eieio object | |
767 ((lambda (thing) (object-p thing)) . data-debug-insert-object-button) | |
768 | |
769 ;; tag | |
770 (semantic-tag-p . data-debug-insert-tag) | |
771 | |
772 ;; taglist | |
773 ((lambda (thing) (and (listp thing) (semantic-tag-p (car thing)))) . | |
774 data-debug-insert-tag-list-button) | |
775 | |
776 ;; find results | |
777 (semanticdb-find-results-p . data-debug-insert-find-results-button) | |
778 | |
779 ;; Elt of a find-results | |
780 ((lambda (thing) (and (listp thing) | |
781 (semanticdb-abstract-table-child-p (car thing)) | |
782 (semantic-tag-p (cdr thing)))) . | |
783 data-debug-insert-db-and-tag-button) | |
784 | |
785 ;; Overlay | 754 ;; Overlay |
786 (data-debug-overlay-p . data-debug-insert-overlay-button) | 755 (data-debug-overlay-p . data-debug-insert-overlay-button) |
787 | 756 |
788 ;; Overlay list | 757 ;; Overlay list |
789 ((lambda (thing) (and (consp thing) (data-debug-overlay-p (car thing)))) . | 758 ((lambda (thing) (and (consp thing) (data-debug-overlay-p (car thing)))) . |
826 | 795 |
827 ;; Vector of stuff | 796 ;; Vector of stuff |
828 (vectorp . data-debug-insert-stuff-vector-button) | 797 (vectorp . data-debug-insert-stuff-vector-button) |
829 ) | 798 ) |
830 "Alist of methods used to insert things into an Ddebug buffer.") | 799 "Alist of methods used to insert things into an Ddebug buffer.") |
800 | |
801 ;; An augmentation function for the thing alist. | |
802 (defun data-debug-add-specialized-thing (predicate fcn) | |
803 "Add a new specialized thing to display with data-debug. | |
804 PREDICATE is a function that returns t if a thing is this new type. | |
805 FCN is a function that will display stuff in the data debug buffer." | |
806 (let ((entry (cons predicate fcn)) | |
807 ;; Specialized entries show up AFTER nil, | |
808 ;; but before listp, vectorp, symbolp, and | |
809 ;; other general things. Splice it into | |
810 ;; the beginning. | |
811 (first (nthcdr 0 data-debug-thing-alist)) | |
812 (second (nthcdr 1 data-debug-thing-alist)) | |
813 ) | |
814 (when (not (member entry data-debug-thing-alist)) | |
815 (setcdr first (cons entry second))))) | |
831 | 816 |
832 ;; uber insert method | 817 ;; uber insert method |
833 (defun data-debug-insert-thing (thing prefix prebuttontext &optional parent) | 818 (defun data-debug-insert-thing (thing prefix prebuttontext &optional parent) |
834 "Insert THING with PREFIX. | 819 "Insert THING with PREFIX. |
835 PREBUTTONTEXT is some text to insert between prefix and the thing | 820 PREBUTTONTEXT is some text to insert between prefix and the thing |
851 'bold))) | 836 'bold))) |
852 | 837 |
853 ;;; MAJOR MODE | 838 ;;; MAJOR MODE |
854 ;; | 839 ;; |
855 ;; The Ddebug major mode provides an interactive space to explore | 840 ;; The Ddebug major mode provides an interactive space to explore |
856 ;; the current state of semantic's parsing and analysis | 841 ;; complicated data structures. |
857 ;; | 842 ;; |
858 (defgroup data-debug nil | 843 (defgroup data-debug nil |
859 "data-debug group." | 844 "data-debug group." |
860 :group 'langauges) | 845 :group 'langauges) |
861 | 846 |
1042 (when (data-debug-line-expandable-p) | 1027 (when (data-debug-line-expandable-p) |
1043 (data-debug-expand-current-line))) | 1028 (data-debug-expand-current-line))) |
1044 | 1029 |
1045 ;;; DEBUG COMMANDS | 1030 ;;; DEBUG COMMANDS |
1046 ;; | 1031 ;; |
1047 ;; Various commands to output aspects of the current semantic environment. | 1032 ;; Various commands for displaying complex data structures. |
1048 | 1033 |
1049 (defun data-debug-edebug-expr (expr) | 1034 (defun data-debug-edebug-expr (expr) |
1050 "Dump out the contets of some expression EXPR in edebug with ddebug." | 1035 "Dump out the contets of some expression EXPR in edebug with ddebug." |
1051 (interactive | 1036 (interactive |
1052 (list (let ((minibuffer-completing-symbol t)) | 1037 (list (let ((minibuffer-completing-symbol t)) |
1090 (prog1 | 1075 (prog1 |
1091 (prin1 (car values) t) | 1076 (prin1 (car values) t) |
1092 (let ((str (eval-expression-print-format (car values)))) | 1077 (let ((str (eval-expression-print-format (car values)))) |
1093 (if str (princ str t)))))) | 1078 (if str (princ str t)))))) |
1094 | 1079 |
1095 | |
1096 (provide 'data-debug) | 1080 (provide 'data-debug) |
1097 | 1081 |
1082 (if (featurep 'eieio) | |
1083 (require 'eieio-datadebug)) | |
1084 | |
1098 ;;; data-debug.el ends here | 1085 ;;; data-debug.el ends here |