summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2001-10-30 03:31:32 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2001-10-30 03:31:32 +0000
commit3ebb84168d40aa6f312ed1ee78a479a0c895fb45 (patch)
tree0114b7d6ab0973cf3596dc139f40788e3ffac4c1 /lisp/emacs-lisp
parent1f79789d4aea615815127596ccb7f3acc0db5c7f (diff)
downloademacs-3ebb84168d40aa6f312ed1ee78a479a0c895fb45.tar.gz
emacs-3ebb84168d40aa6f312ed1ee78a479a0c895fb45.tar.bz2
emacs-3ebb84168d40aa6f312ed1ee78a479a0c895fb45.zip
(delay-mode-hooks): Add edebug-spec.
(edebug-instrument-function): Use `find-function-noselect'.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/edebug.el17
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."
(def-edebug-spec with-output-to-string t)
(def-edebug-spec with-current-buffer t)
(def-edebug-spec combine-after-change-calls t)
+(def-edebug-spec delay-mode-hooks t)
(def-edebug-spec with-temp-file t)
(def-edebug-spec with-temp-buffer t)
(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."
(defun edebug-instrument-function (func)
;; Func should be a function symbol.
;; Return the function symbol, or nil if not instrumented.
- (let ((func-marker))
- (setq func-marker (get func 'edebug))
+ (let ((func-marker (get func 'edebug)))
(cond
((markerp func-marker)
;; It is uninstrumented, so instrument it.
- (save-excursion
- (set-buffer (marker-buffer func-marker))
+ (with-current-buffer (marker-buffer func-marker)
(goto-char func-marker)
(edebug-eval-top-level-form)
func))
((consp func-marker)
(message "%s is already instrumented." func)
func)
- (t
- ;; We could try harder, e.g. do a tags search.
- (error "Don't know where %s is defined" func)
- nil))))
+ (t
+ (let ((loc (find-function-noselect func)))
+ (with-current-buffer (car loc)
+ (goto-char (cdr loc))
+ (edebug-eval-top-level-form)
+ func))))))
(defun edebug-instrument-callee ()
"Instrument the definition of the function or macro about to be called.