/[emacs]/emacs/lisp/emacs-lisp/edebug.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/edebug.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3.63 by miles, Mon Sep 1 15:45:22 2003 UTC revision 3.64 by rms, Fri Sep 19 14:31:15 2003 UTC
# Line 2241  error is signaled again." Line 2241  error is signaled again."
2241    
2242              ;; Save the outside value of executing macro.  (here??)              ;; Save the outside value of executing macro.  (here??)
2243              (edebug-outside-executing-macro executing-kbd-macro)              (edebug-outside-executing-macro executing-kbd-macro)
2244              (edebug-outside-pre-command-hook pre-command-hook)              (edebug-outside-pre-command-hook
2245              (edebug-outside-post-command-hook post-command-hook))               (edebug-var-status 'pre-command-hook))
2246                (edebug-outside-post-command-hook
2247                 (edebug-var-status 'post-command-hook)))
2248          (unwind-protect          (unwind-protect
2249              (let (;; Don't keep reading from an executing kbd macro              (let (;; Don't keep reading from an executing kbd macro
2250                    ;; within edebug unless edebug-continue-kbd-macro is                    ;; within edebug unless edebug-continue-kbd-macro is
# Line 2267  error is signaled again." Line 2269  error is signaled again."
2269                      edebug-next-execution-mode nil)                      edebug-next-execution-mode nil)
2270                (edebug-enter edebug-function edebug-args edebug-body))                (edebug-enter edebug-function edebug-args edebug-body))
2271            ;; Reset global variables in case outside value was changed.            ;; Reset global variables in case outside value was changed.
2272            (setq executing-kbd-macro edebug-outside-executing-macro            (setq executing-kbd-macro edebug-outside-executing-macro)
2273                  pre-command-hook edebug-outside-pre-command-hook            (edebug-restore-status
2274                  post-command-hook edebug-outside-post-command-hook             'post-command-hook edebug-outside-post-command-hook)
2275                  )))            (edebug-restore-status
2276               'pre-command-hook edebug-outside-pre-command-hook)))
2277    
2278      (let* ((edebug-data (get edebug-function 'edebug))      (let* ((edebug-data (get edebug-function 'edebug))
2279             (edebug-def-mark (car edebug-data)) ; mark at def start             (edebug-def-mark (car edebug-data)) ; mark at def start
# Line 2291  error is signaled again." Line 2294  error is signaled again."
2294          (funcall edebug-body))          (funcall edebug-body))
2295        )))        )))
2296    
2297    (defun edebug-var-status (var)
2298      "Return a cons cell describing the status of VAR's current binding.
2299    The purpose of this function is so you can properly undo
2300    subsequent changes to the same binding, by passing the status
2301    cons cell to `edebug-restore-status'.  The status cons cell
2302    has the form (LOCUS . VALUE), where LOCUS can be a buffer
2303    \(for a buffer-local binding), a frame (for a frame-local binding),
2304    or nil (if the default binding is current)."
2305      (cons (variable-binding-locus var)
2306            (symbol-value var)))
2307    
2308    (defun edebug-restore-status (var status)
2309      "Reset VAR based on STATUS.
2310    STATUS should be a list you got from `edebug-var-status'."
2311      (let ((locus (car status))
2312            (value (cdr status)))
2313        (cond ((bufferp locus)
2314               (if (buffer-live-p locus)
2315                   (with-current-buffer locus
2316                     (set var value))))
2317              ((framep locus)
2318               (modify-frame-parameters locus (list (cons var value))))
2319              (t
2320               (set var value)))))
2321    
2322  (defun edebug-enter-trace (edebug-body)  (defun edebug-enter-trace (edebug-body)
2323    (let ((edebug-stack-depth (1+ edebug-stack-depth))    (let ((edebug-stack-depth (1+ edebug-stack-depth))
# Line 3511  Return the result of the last expression Line 3538  Return the result of the last expression
3538    
3539             (executing-kbd-macro edebug-outside-executing-macro)             (executing-kbd-macro edebug-outside-executing-macro)
3540             (defining-kbd-macro edebug-outside-defining-kbd-macro)             (defining-kbd-macro edebug-outside-defining-kbd-macro)
3541             (pre-command-hook edebug-outside-pre-command-hook)             ;; Get the values out of the saved statuses.
3542             (post-command-hook edebug-outside-post-command-hook)             (pre-command-hook (cdr edebug-outside-pre-command-hook))
3543               (post-command-hook (cdr edebug-outside-post-command-hook))
3544    
3545             ;; See edebug-display             ;; See edebug-display
3546             (overlay-arrow-position edebug-outside-o-a-p)             (overlay-arrow-position edebug-outside-o-a-p)
# Line 3552  Return the result of the last expression Line 3580  Return the result of the last expression
3580    
3581            edebug-outside-executing-macro executing-kbd-macro            edebug-outside-executing-macro executing-kbd-macro
3582            edebug-outside-defining-kbd-macro defining-kbd-macro            edebug-outside-defining-kbd-macro defining-kbd-macro
           edebug-outside-pre-command-hook pre-command-hook  
           edebug-outside-post-command-hook post-command-hook  
3583    
3584            edebug-outside-o-a-p overlay-arrow-position            edebug-outside-o-a-p overlay-arrow-position
3585            edebug-outside-o-a-s overlay-arrow-string            edebug-outside-o-a-s overlay-arrow-string
3586            edebug-outside-c-i-e-a cursor-in-echo-area            edebug-outside-c-i-e-a cursor-in-echo-area
3587            )))                           ; let            )
3588    
3589             ;; Restore the outside saved values; don't alter
3590             ;; the outside binding loci.
3591             (setcdr edebug-outside-pre-command-hook pre-command-hook)
3592             (setcdr edebug-outside-post-command-hook post-command-hook)
3593    
3594             ))                             ; let
3595       ))       ))
3596    
3597  (defvar cl-debug-env nil) ;; defined in cl; non-nil when lexical env used.  (defvar cl-debug-env nil) ;; defined in cl; non-nil when lexical env used.
# Line 3676  Print result in minibuffer." Line 3709  Print result in minibuffer."
3709      (edebug-safe-prin1-to-string (car values)))))      (edebug-safe-prin1-to-string (car values)))))
3710    
3711  (defun edebug-eval-last-sexp ()  (defun edebug-eval-last-sexp ()
3712    "Evaluate sexp before point in the outside environment;    "Evaluate sexp before point in the outside environment; value in minibuffer."
 print value in minibuffer."  
3713    (interactive)    (interactive)
3714    (edebug-eval-expression (edebug-last-sexp)))    (edebug-eval-expression (edebug-last-sexp)))
3715    
3716  (defun edebug-eval-print-last-sexp ()  (defun edebug-eval-print-last-sexp ()
3717    "Evaluate sexp before point in the outside environment;    "Evaluate sexp before point in the outside environment; insert the value.
3718  print value into current buffer."  This prints the value into current buffer."
3719    (interactive)    (interactive)
3720    (let* ((edebug-form (edebug-last-sexp))    (let* ((edebug-form (edebug-last-sexp))
3721           (edebug-result-string           (edebug-result-string
# Line 3698  print value into current buffer." Line 3730  print value into current buffer."
3730    
3731  ;;; Edebug Minor Mode  ;;; Edebug Minor Mode
3732    
3733  ;; Global GUD bindings for all emacs-lisp-mode buffers.  (defvar gud-inhibit-global-bindings
3734  (define-key emacs-lisp-mode-map "\C-x\C-a\C-s" 'edebug-step-mode)    "*Non-nil means don't do global rebindings of C-x C-a subcommands.")
 (define-key emacs-lisp-mode-map "\C-x\C-a\C-n" 'edebug-next-mode)  
 (define-key emacs-lisp-mode-map "\C-x\C-a\C-c" 'edebug-go-mode)  
 (define-key emacs-lisp-mode-map "\C-x\C-a\C-l" 'edebug-where)  
3735    
3736    ;; Global GUD bindings for all emacs-lisp-mode buffers.
3737    (unless gud-inhibit-global-bindings
3738      (define-key emacs-lisp-mode-map "\C-x\C-a\C-s" 'edebug-step-mode)
3739      (define-key emacs-lisp-mode-map "\C-x\C-a\C-n" 'edebug-next-mode)
3740      (define-key emacs-lisp-mode-map "\C-x\C-a\C-c" 'edebug-go-mode)
3741      (define-key emacs-lisp-mode-map "\C-x\C-a\C-l" 'edebug-where))
3742    
3743  (defvar edebug-mode-map  (defvar edebug-mode-map
3744    (let ((map (copy-keymap emacs-lisp-mode-map)))    (let ((map (copy-keymap emacs-lisp-mode-map)))

Legend:
Removed from v.3.63  
changed lines
  Added in v.3.64

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26