Mercurial > emacs
annotate lisp/emacs-lisp/eieio-datadebug.el @ 112344:7c2cdabbc4a9
* image.c (syms_of_image): Don't access XSYMBOL's internals directly.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 16 Jan 2011 10:40:47 -0500 |
parents | 376148b31b5e |
children | 417b1e4d63cd |
rev | line source |
---|---|
105243
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; eieio-datadebug.el --- EIEIO extensions to the data debugger. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
112218
376148b31b5e
Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
3 ;; Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
105243
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
4 |
105327 | 5 ;; Author: Eric M. Ludlam <zappo@gnu.org> |
105243
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 ;; Keywords: OO, lisp |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 ;; (at your option) any later version. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 ;; GNU Emacs is distributed in the hope that it will be useful, |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 ;; GNU General Public License for more details. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 ;;; Commentary: |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; Extensions to data-debug for EIEIO objects. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 (require 'eieio) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 (require 'data-debug) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 ;;; Code: |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 (defun data-debug-insert-object-slots (object prefix) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 "Insert all the slots of OBJECT. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 PREFIX specifies what to insert at the start of each line." |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 (let ((attrprefix (concat (make-string (length prefix) ? ) "] "))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
37 (data-debug/eieio-insert-slots object attrprefix))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 (defun data-debug-insert-object-slots-from-point (point) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 "Insert the object slots found at the object button at POINT." |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
41 (let ((object (get-text-property point 'ddebug)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
42 (indent (get-text-property point 'ddebug-indent)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
43 start) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 (end-of-line) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 (setq start (point)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 (forward-char 1) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 (data-debug-insert-object-slots object |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 (concat (make-string indent ? ) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 "~ ")) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 (goto-char start))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 (defun data-debug-insert-object-button (object prefix prebuttontext) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 "Insert a button representing OBJECT. |
105327 | 54 PREFIX is the text that precedes the button. |
105243
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 PREBUTTONTEXT is some text between PREFIX and the object button." |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 (let ((start (point)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 (end nil) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 (str (object-print object)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 (tip (format "Object %s\nClass: %S\nParent(s): %S\n%d slots" |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 (object-name-string object) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (object-class object) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (class-parents (object-class object)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 (length (object-slots object)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 )) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 ) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 (insert prefix prebuttontext str) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 (setq end (point)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 (put-text-property (- end (length str)) end 'face 'font-lock-keyword-face) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 (put-text-property start end 'ddebug object) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 (put-text-property start end 'ddebug-indent(length prefix)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 (put-text-property start end 'ddebug-prefix prefix) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
72 (put-text-property start end 'help-echo tip) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 (put-text-property start end 'ddebug-function |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 'data-debug-insert-object-slots-from-point) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 (insert "\n"))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 ;;; METHODS |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 ;; Each object should have an opportunity to show stuff about itself. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 (defmethod data-debug/eieio-insert-slots ((obj eieio-default-superclass) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 prefix) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 "Insert the slots of OBJ into the current DDEBUG buffer." |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 (data-debug-insert-thing (object-name-string obj) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
85 prefix |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 "Name: ") |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 (let* ((cl (object-class obj)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 (cv (class-v cl))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 (data-debug-insert-thing (class-constructor cl) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 prefix |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 "Class: ") |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
92 ;; Loop over all the public slots |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 (let ((publa (aref cv class-public-a)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
94 (publd (aref cv class-public-d)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 ) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
96 (while publa |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 (if (slot-boundp obj (car publa)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 (let ((i (class-slot-initarg cl (car publa))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 (v (eieio-oref obj (car publa)))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 (data-debug-insert-thing |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 v prefix (concat |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 (if i (symbol-name i) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 (symbol-name (car publa))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 " "))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 ;; Unbound case |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 (let ((i (class-slot-initarg cl (car publa)))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 (data-debug-insert-custom |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 "#unbound" prefix |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 (concat (if i (symbol-name i) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
110 (symbol-name (car publa))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 " ") |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
112 'font-lock-keyword-face)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
113 ) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
114 (setq publa (cdr publa) publd (cdr publd)))))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 ;;; Augment the Data debug thing display list. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 (data-debug-add-specialized-thing (lambda (thing) (object-p thing)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 #'data-debug-insert-object-button) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 ;;; DEBUG METHODS |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 ;; A generic function to run DDEBUG on an object and popup a new buffer. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
124 (defmethod data-debug-show ((obj eieio-default-superclass)) |
105474 | 125 "Run ddebug against any EIEIO object OBJ." |
105243
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 (data-debug-new-buffer (format "*%s DDEBUG*" (object-name obj))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 (data-debug-insert-object-slots obj "]")) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
128 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
129 ;;; DEBUG FUNCTIONS |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
131 (defun eieio-debug-methodinvoke (method class) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
132 "Show the method invocation order for METHOD with CLASS object." |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
133 (interactive "aMethod: \nXClass Expression: ") |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
134 (let* ((eieio-pre-method-execution-hooks |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
135 (lambda (l) (throw 'moose l) )) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 (data |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
137 (catch 'moose (eieio-generic-call |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 method (list class)))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 (buf (data-debug-new-buffer "*Method Invocation*")) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
140 (data2 (mapcar (lambda (sym) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 (symbol-function (car sym))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
142 data))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
143 (data-debug-insert-thing data2 ">" ""))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
144 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
145 (provide 'eieio-datadebug) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
146 |
105377 | 147 ;; arch-tag: 6c7c2890-7614-41b0-816b-c61f3f6a8130 |
105243
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
148 ;;; eieio-datadebug.el ends here |