diff options
| author | Stefan Monnier | 2001-10-30 03:31:32 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-10-30 03:31:32 +0000 |
| commit | 3ebb84168d40aa6f312ed1ee78a479a0c895fb45 (patch) | |
| tree | 0114b7d6ab0973cf3596dc139f40788e3ffac4c1 | |
| parent | 1f79789d4aea615815127596ccb7f3acc0db5c7f (diff) | |
| download | emacs-3ebb84168d40aa6f312ed1ee78a479a0c895fb45.tar.gz emacs-3ebb84168d40aa6f312ed1ee78a479a0c895fb45.zip | |
(delay-mode-hooks): Add edebug-spec.
(edebug-instrument-function): Use `find-function-noselect'.
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 9de725531a0..ea44471a12c 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -2097,6 +2097,7 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 2097 | (def-edebug-spec with-output-to-string t) | 2097 | (def-edebug-spec with-output-to-string t) |
| 2098 | (def-edebug-spec with-current-buffer t) | 2098 | (def-edebug-spec with-current-buffer t) |
| 2099 | (def-edebug-spec combine-after-change-calls t) | 2099 | (def-edebug-spec combine-after-change-calls t) |
| 2100 | (def-edebug-spec delay-mode-hooks t) | ||
| 2100 | (def-edebug-spec with-temp-file t) | 2101 | (def-edebug-spec with-temp-file t) |
| 2101 | (def-edebug-spec with-temp-buffer t) | 2102 | (def-edebug-spec with-temp-buffer t) |
| 2102 | (def-edebug-spec with-temp-message t) | 2103 | (def-edebug-spec with-temp-message t) |
| @@ -3348,23 +3349,23 @@ go to the end of the last sexp, or if that is the same point, then step." | |||
| 3348 | (defun edebug-instrument-function (func) | 3349 | (defun edebug-instrument-function (func) |
| 3349 | ;; Func should be a function symbol. | 3350 | ;; Func should be a function symbol. |
| 3350 | ;; Return the function symbol, or nil if not instrumented. | 3351 | ;; Return the function symbol, or nil if not instrumented. |
| 3351 | (let ((func-marker)) | 3352 | (let ((func-marker (get func 'edebug))) |
| 3352 | (setq func-marker (get func 'edebug)) | ||
| 3353 | (cond | 3353 | (cond |
| 3354 | ((markerp func-marker) | 3354 | ((markerp func-marker) |
| 3355 | ;; It is uninstrumented, so instrument it. | 3355 | ;; It is uninstrumented, so instrument it. |
| 3356 | (save-excursion | 3356 | (with-current-buffer (marker-buffer func-marker) |
| 3357 | (set-buffer (marker-buffer func-marker)) | ||
| 3358 | (goto-char func-marker) | 3357 | (goto-char func-marker) |
| 3359 | (edebug-eval-top-level-form) | 3358 | (edebug-eval-top-level-form) |
| 3360 | func)) | 3359 | func)) |
| 3361 | ((consp func-marker) | 3360 | ((consp func-marker) |
| 3362 | (message "%s is already instrumented." func) | 3361 | (message "%s is already instrumented." func) |
| 3363 | func) | 3362 | func) |
| 3364 | (t | 3363 | (t |
| 3365 | ;; We could try harder, e.g. do a tags search. | 3364 | (let ((loc (find-function-noselect func))) |
| 3366 | (error "Don't know where %s is defined" func) | 3365 | (with-current-buffer (car loc) |
| 3367 | nil)))) | 3366 | (goto-char (cdr loc)) |
| 3367 | (edebug-eval-top-level-form) | ||
| 3368 | func)))))) | ||
| 3368 | 3369 | ||
| 3369 | (defun edebug-instrument-callee () | 3370 | (defun edebug-instrument-callee () |
| 3370 | "Instrument the definition of the function or macro about to be called. | 3371 | "Instrument the definition of the function or macro about to be called. |