]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/edebug.el
(eldoc-function-argstring-from-docstring): Add search that finds arglist
[gnu-emacs] / lisp / emacs-lisp / edebug.el
index 7931e449b7580e15ce53271e9f4721a36a155fba..e6edb4d6c5a444d5c4f6eb39cdc772d5e3d9e7e6 100644 (file)
@@ -8,7 +8,7 @@
 ;; LCD Archive Entry:
 ;; edebug|Daniel LaLiberte|liberte@cs.uiuc.edu
 ;; |A source level debugger for Emacs Lisp.
-;; |$Date: 1996/03/20 13:19:48 $|$Revision: 3.5.1.27 $|~/modes/edebug.el|
+;; |$Date: 1996/09/24 06:54:18 $|$Revision: 3.10 $|~/modes/edebug.el|
 
 ;; This file is part of GNU Emacs.
 
@@ -85,7 +85,7 @@
 ;;; Code:
 
 (defconst edebug-version
-  (let ((raw-version "$Revision: 3.5.1.27 $"))
+  (let ((raw-version "$Revision: 3.10 $"))
     (substring raw-version (string-match "[0-9.]*" raw-version)
               (match-end 0))))
      
@@ -2118,6 +2118,14 @@ expressions; a `progn' form will be returned enclosing these forms."
 (def-edebug-spec eval-when-compile t)
 (def-edebug-spec eval-and-compile t)
 
+(def-edebug-spec save-selected-window t)
+(def-edebug-spec save-current-buffer t)
+(def-edebug-spec save-match-data t)
+(def-edebug-spec with-output-to-string t)
+(def-edebug-spec with-current-buffer t)
+(def-edebug-spec with-temp-file t)
+(def-edebug-spec with-temp-buffer t)
+
 ;; Anything else?
 
 
@@ -2195,21 +2203,11 @@ expressions; a `progn' form will be returned enclosing these forms."
 
 (defvar edebug-outside-pre-command-hook)
 (defvar edebug-outside-post-command-hook)
-(defvar edebug-outside-post-command-idle-hook)
-
-;; Emacs 19
-(defvar pre-command-hook nil)
-(defvar post-command-hook nil)
-(defvar post-command-idle-hook nil)
 
 (defvar cl-lexical-debug)  ;; Defined in cl.el
 
 ;;; Handling signals
 
-(if (not (fboundp 'edebug-original-signal))
-    (defalias 'edebug-original-signal (symbol-function 'signal)))
-;; We should use advise for this!!
-
 (defun edebug-signal (edebug-signal-name edebug-signal-data)
   "Signal an error.  Args are SIGNAL-NAME, and associated DATA.
 A signal name is a symbol with an `error-conditions' property
@@ -2229,8 +2227,7 @@ error is signaled again."
       (edebug 'error (cons edebug-signal-name edebug-signal-data)))
   ;; If we reach here without another non-local exit, then send signal again.
   ;; i.e. the signal is not continuable, yet.
-  (edebug-original-signal edebug-signal-name edebug-signal-data))
-  
+  (signal edebug-signal-name edebug-signal-data))
 
 ;;; Entering Edebug
 
@@ -2263,37 +2260,32 @@ error is signaled again."
            (cl-lexical-debug t)
 
            ;; Save the outside value of executing macro.  (here??)
-           (edebug-outside-executing-macro executing-macro)
+           (edebug-outside-executing-macro executing-kbd-macro)
            (edebug-outside-pre-command-hook pre-command-hook)
-           (edebug-outside-post-command-hook post-command-hook)
-           (edebug-outside-post-command-idle-hook post-command-idle-hook))
+           (edebug-outside-post-command-hook post-command-hook))
        (unwind-protect
            (let (;; Don't keep reading from an executing kbd macro
                  ;; within edebug unless edebug-continue-kbd-macro is
                  ;; non-nil.  Again, local binding may not be best.
-                 (executing-macro 
-                  (if edebug-continue-kbd-macro executing-macro))
+                 (executing-kbd-macro 
+                  (if edebug-continue-kbd-macro executing-kbd-macro))
+
+                 (signal-hook-function 'edebug-signal)
 
                  ;; Disable command hooks.  This is essential when
                  ;; a hook function is instrumented - to avoid infinite loop.
                  ;; This may be more than we need, however.
                  (pre-command-hook nil)
-                 (post-command-hook nil)
-                 (post-command-idle-hook nil))
+                 (post-command-hook nil))
              (setq edebug-execution-mode (or edebug-next-execution-mode 
                                              edebug-initial-mode 
                                              edebug-execution-mode)
                    edebug-next-execution-mode nil)
-             ;; Bind signal to edebug-signal only while Edebug is active.
-             (fset 'signal 'edebug-signal)
-             (unwind-protect
-                 (edebug-enter edebug-function edebug-args edebug-body)
-               (fset 'signal (symbol-function 'edebug-original-signal))))
+             (edebug-enter edebug-function edebug-args edebug-body))
          ;; Reset global variables in case outside value was changed.
-         (setq executing-macro edebug-outside-executing-macro
+         (setq executing-kbd-macro edebug-outside-executing-macro
                pre-command-hook edebug-outside-pre-command-hook
                post-command-hook edebug-outside-post-command-hook
-               post-command-idle-hook edebug-outside-post-command-idle-hook
                )))
     
     (let* ((edebug-data (get edebug-function 'edebug))
@@ -2872,14 +2864,14 @@ MSG is printed after `::::} '."
              (message "Break"))
 
          (setq buffer-read-only t)
-         (fset 'signal (symbol-function 'edebug-original-signal))
+         (setq signal-hook-function nil)
 
          (edebug-mode)
          (unwind-protect
              (recursive-edit)          ;  <<<<<<<<<< Recursive edit
 
            ;; Do the following, even if quit occurs.
-           (fset 'signal 'edebug-signal)
+           (setq signal-hook-function 'edebug-signal)
            (if edebug-backtrace-buffer
                (kill-buffer edebug-backtrace-buffer))
            ;; Could be an option to keep eval display up.
@@ -3565,11 +3557,10 @@ Return the result of the last expression."
             (standard-output edebug-outside-standard-output)
             (standard-input edebug-outside-standard-input)
 
-            (executing-macro edebug-outside-executing-macro)
+            (executing-kbd-macro edebug-outside-executing-macro)
             (defining-kbd-macro edebug-outside-defining-kbd-macro)
             (pre-command-hook edebug-outside-pre-command-hook)
             (post-command-hook edebug-outside-post-command-hook)
-            (post-command-idle-hook edebug-outside-post-command-idle-hook)
 
             ;; See edebug-display
             (overlay-arrow-position edebug-outside-o-a-p)
@@ -3607,11 +3598,10 @@ Return the result of the last expression."
            edebug-outside-standard-output standard-output
            edebug-outside-standard-input standard-input
 
-           edebug-outside-executing-macro executing-macro
+           edebug-outside-executing-macro executing-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
-           edebug-outside-post-command-idle-hook post-command-idle-hook
 
            edebug-outside-o-a-p overlay-arrow-position
            edebug-outside-o-a-s overlay-arrow-string
@@ -4140,7 +4130,8 @@ You must include newlines in FMT to break lines, but one newline is appended."
 ;;      (edebug-trace-display "*trace-point*"
 ;;       "saving: point = %s  window-start = %s"
 ;;       (point) (window-start))
-  (let* ((selected-window (selected-window))
+  (let* ((oldbuf (current-buffer))
+        (selected-window (selected-window))
         (buffer (get-buffer-create buf-name))
         buf-window)
 ;;    (message "before pop-to-buffer") (sit-for 1)
@@ -4156,7 +4147,8 @@ You must include newlines in FMT to break lines, but one newline is appended."
 ;;    (set-window-point buf-window (point))
 ;;    (edebug-sit-for 0)
     (bury-buffer buffer)
-    (select-window selected-window))
+    (select-window selected-window)
+    (set-buffer oldbuf))
   buf-name)
 
 
@@ -4335,10 +4327,6 @@ It is removed when you hit any char."
   (defun edebug-mark ()
     (mark t));; Does this work for lemacs too?
 
-  ;; Use minibuffer-history when reading expressions.
-  (defvar read-expression-history) ;; hush bytecomp
-  (defvar read-expression-map)
-
   (defun edebug-set-conditional-breakpoint (arg condition)
     "Set a conditional breakpoint at nearest sexp.
 The condition is evaluated in the outside context.
@@ -4491,7 +4479,6 @@ Print result in minibuffer."
      edebug-sit-for
      edebug-prin1-to-string 
      edebug-format
-     edebug-original-signal
      ;; lemacs
      zmacs-deactivate-region
      popup-menu