Mercurial > emacs
annotate lisp/emacs-lisp/eieio-datadebug.el @ 111684:280ee0988e1a
* lisp/shell.el (shell): Use current-buffer by default if it's already
a shell mode buffer and its process is dead. Suggested by <jemarch@gnu.org>.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 23 Nov 2010 09:19:54 -0500 |
parents | 280c8ae2476d |
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 |
106815 | 3 ;; Copyright (C) 2007, 2008, 2009, 2010 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 |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
7 ;; Package: eieio |
105243
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; 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
|
12 ;; 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
|
13 ;; 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
|
14 ;; (at your option) any later version. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; 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
|
17 ;; 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
|
18 ;; 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
|
19 ;; GNU General Public License for more details. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 ;; 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
|
22 ;; 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
|
23 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;;; Commentary: |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 ;; Extensions to data-debug for EIEIO objects. |
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 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 (require 'eieio) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 (require 'data-debug) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 ;;; Code: |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 (defun data-debug-insert-object-slots (object prefix) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 "Insert all the slots of OBJECT. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 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
|
37 (let ((attrprefix (concat (make-string (length prefix) ? ) "] "))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 (data-debug/eieio-insert-slots object attrprefix))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 (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
|
41 "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
|
42 (let ((object (get-text-property point 'ddebug)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
43 (indent (get-text-property point 'ddebug-indent)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 start) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 (end-of-line) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 (setq start (point)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 (forward-char 1) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 (data-debug-insert-object-slots object |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 (concat (make-string indent ? ) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 "~ ")) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 (goto-char start))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 (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
|
54 "Insert a button representing OBJECT. |
105327 | 55 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
|
56 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
|
57 (let ((start (point)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 (end nil) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 (str (object-print object)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 (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
|
61 (object-name-string object) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (object-class object) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 (class-parents (object-class object)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 (length (object-slots object)) |
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 ) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 (insert prefix prebuttontext str) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 (setq end (point)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 (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
|
70 (put-text-property start end 'ddebug object) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 (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
|
72 (put-text-property start end 'ddebug-prefix prefix) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 (put-text-property start end 'help-echo tip) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 (put-text-property start end 'ddebug-function |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 'data-debug-insert-object-slots-from-point) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 (insert "\n"))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 ;;; METHODS |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 ;; 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
|
81 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 (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
|
83 prefix) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 "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
|
85 (data-debug-insert-thing (object-name-string obj) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 prefix |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 "Name: ") |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 (let* ((cl (object-class obj)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 (cv (class-v cl))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 (data-debug-insert-thing (class-constructor cl) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 prefix |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
92 "Class: ") |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 ;; Loop over all the public slots |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
94 (let ((publa (aref cv class-public-a)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 (publd (aref cv class-public-d)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
96 ) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 (while publa |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 (if (slot-boundp obj (car publa)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 (let ((i (class-slot-initarg cl (car publa))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 (v (eieio-oref obj (car publa)))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 (data-debug-insert-thing |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 v prefix (concat |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 (if i (symbol-name i) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 (symbol-name (car publa))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 " "))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 ;; Unbound case |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 (let ((i (class-slot-initarg cl (car publa)))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 (data-debug-insert-custom |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 "#unbound" prefix |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
110 (concat (if i (symbol-name i) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 (symbol-name (car publa))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
112 " ") |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
113 'font-lock-keyword-face)) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
114 ) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 (setq publa (cdr publa) publd (cdr publd)))))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 ;;; Augment the Data debug thing display list. |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 (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
|
119 #'data-debug-insert-object-button) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 ;;; DEBUG METHODS |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 ;; 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
|
124 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
125 (defmethod data-debug-show ((obj eieio-default-superclass)) |
105474 | 126 "Run ddebug against any EIEIO object OBJ." |
105243
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 (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
|
128 (data-debug-insert-object-slots obj "]")) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
129 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 ;;; DEBUG FUNCTIONS |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
131 ;; |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
132 (defun eieio-debug-methodinvoke (method class) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
133 "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
|
134 (interactive "aMethod: \nXClass Expression: ") |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
135 (let* ((eieio-pre-method-execution-hooks |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 (lambda (l) (throw 'moose l) )) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
137 (data |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 (catch 'moose (eieio-generic-call |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 method (list class)))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
140 (buf (data-debug-new-buffer "*Method Invocation*")) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 (data2 (mapcar (lambda (sym) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
142 (symbol-function (car sym))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
143 data))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
144 (data-debug-insert-thing data2 ">" ""))) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
145 |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
146 (provide 'eieio-datadebug) |
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
147 |
105377 | 148 ;; arch-tag: 6c7c2890-7614-41b0-816b-c61f3f6a8130 |
105243
4b2a0c5f8552
* emacs-lisp/eieio-datadebug.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
149 ;;; eieio-datadebug.el ends here |