Mercurial > emacs
comparison lisp/emacs-lisp/edebug.el @ 727:540b047ece4d
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Wed, 24 Jun 1992 05:09:26 +0000 |
parents | 36fbc3f71803 |
children | cd00bdacc17b |
comparison
equal
deleted
inserted
replaced
726:5f08efa38dd0 | 727:540b047ece4d |
---|---|
173 ;;; Installation | 173 ;;; Installation |
174 ;;; ------------ | 174 ;;; ------------ |
175 ;; Put edebug.el in some directory in your load-path and byte-compile it. | 175 ;; Put edebug.el in some directory in your load-path and byte-compile it. |
176 | 176 |
177 ;; Put the following forms in your .emacs file. | 177 ;; Put the following forms in your .emacs file. |
178 ;; (setq edebug-global-prefix "...whatever you want") ; default is C-xX | |
179 ;; (define-key emacs-lisp-mode-map "\^Xx" 'edebug-defun) | 178 ;; (define-key emacs-lisp-mode-map "\^Xx" 'edebug-defun) |
180 ;; (autoload 'edebug-defun "edebug") | 179 ;; (autoload 'edebug-defun "edebug") |
181 ;; (autoload 'edebug-debug "edebug") | 180 ;; (autoload 'edebug-debug "edebug") |
182 ;; (setq debugger 'edebug-debug) | 181 ;; (setq debugger 'edebug-debug) |
183 ;; ... other options, described in the next section. | 182 ;; ... other options, described in the next section. |
457 (goto-char edebug-e-r-pnt))) | 456 (goto-char edebug-e-r-pnt))) |
458 nil | 457 nil |
459 )) | 458 )) |
460 | 459 |
461 | 460 |
461 (defun edebug-eval-current-buffer (&optional edebug-e-c-b-output) | |
462 "Call eval-region on the whole buffer." | |
463 (interactive) | |
464 (eval-region (point-min) (point-max) edebug-e-c-b-output)) | |
465 | |
466 (defun edebug-eval-buffer (&optional buffer edebug-e-c-b-output) | |
467 "Call eval-region on the whole buffer." | |
468 (interactive "bEval buffer: ") | |
469 (save-excursion | |
470 (set-buffer buffer) | |
471 (eval-region (point-min) (point-max) edebug-e-c-b-output))) | |
472 | |
462 ;; The standard eval-current-buffer doesn't use eval-region. | 473 ;; The standard eval-current-buffer doesn't use eval-region. |
463 (if (not (fboundp 'edebug-emacs-eval-current-buffer)) | 474 (if (and (fboundp 'eval-current-buffer) |
464 (fset 'edebug-emacs-eval-current-buffer | 475 (not (fboundp 'edebug-emacs-eval-current-buffer))) |
465 (symbol-function 'eval-current-buffer))) | 476 (progn |
466 ;; (fset 'eval-current-buffer (symbol-function 'edebug-emacs-eval-current-buffer)) | 477 (fset 'edebug-emacs-eval-current-buffer |
467 | 478 (symbol-function 'eval-current-buffer)) |
468 (defun eval-current-buffer (&optional edebug-e-c-b-output) | 479 (fset 'eval-current-buffer 'edebug-eval-current-buffer))) |
469 "Call eval-region on the whole buffer." | 480 (if (and (fboundp 'eval-buffer) |
470 (interactive) | 481 (not (fboundp 'edebug-emacs-eval-buffer))) |
471 (eval-region (point-min) (point-max) edebug-e-c-b-output)) | 482 (progn |
483 (fset 'edebug-emacs-eval-buffer | |
484 (symbol-function 'eval-buffer)) | |
485 (fset 'eval-buffer 'edebug-eval-buffer))) | |
472 | 486 |
473 | 487 |
474 | 488 |
475 ;;;====================================================================== | 489 ;;;====================================================================== |
476 ;;; The Parser | 490 ;;; The Parser |
496 ;;; edebug-enter, which supplies the function name and the actual | 510 ;;; edebug-enter, which supplies the function name and the actual |
497 ;;; arguments to the function. See functions edebug and edebug-enter | 511 ;;; arguments to the function. See functions edebug and edebug-enter |
498 ;;; for more details. | 512 ;;; for more details. |
499 | 513 |
500 | 514 |
515 ;;;###autoload | |
501 (defun edebug-defun () | 516 (defun edebug-defun () |
502 "Evaluate defun or defmacro, like eval-defun, but with edebug calls. | 517 "Evaluate defun or defmacro, like eval-defun, but with edebug calls. |
503 Print its name in the minibuffer and leave point after any error it finds, | 518 Print its name in the minibuffer and leave point after any error it finds, |
504 with mark at the original point." | 519 with mark at the original point." |
505 (interactive) | 520 (interactive) |
2414 ;; (setq debugger 'debug) ; use the default | 2429 ;; (setq debugger 'debug) ; use the default |
2415 | 2430 |
2416 ;; Note that debug and its utilities must be byte-compiled to work, since | 2431 ;; Note that debug and its utilities must be byte-compiled to work, since |
2417 ;; they depend on the backtrace looking a certain way. | 2432 ;; they depend on the backtrace looking a certain way. |
2418 | 2433 |
2434 ;;;###autoload | |
2419 (defun edebug-debug (&rest debugger-args) | 2435 (defun edebug-debug (&rest debugger-args) |
2420 "Replacement for debug. | 2436 "Replacement for debug. |
2421 If an error or quit occurred and we are running an edebugged function, | 2437 If an error or quit occurred and we are running an edebugged function, |
2422 show where we last were. Otherwise call debug normally." | 2438 show where we last were. Otherwise call debug normally." |
2423 (if (and edebug-backtrace ; anything active? | 2439 (if (and edebug-backtrace ; anything active? |