emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109990: * lisp/emacs-lisp/edebug.el


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109990: * lisp/emacs-lisp/edebug.el (edebug-enter): Don't mess with
Date: Wed, 12 Sep 2012 09:12:48 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109990
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12345
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2012-09-12 09:12:48 -0400
message:
  * lisp/emacs-lisp/edebug.el (edebug-enter): Don't mess with
  overriding-local-map and pre/post-command-hook here.
  (edebug-recursive-edit): Do it here instead.
  (edebug-outside-unread-command-char): Remove all uses of
  unread-command-char.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/edebug.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-12 00:14:50 +0000
+++ b/lisp/ChangeLog    2012-09-12 13:12:48 +0000
@@ -1,5 +1,11 @@
 2012-09-12  Stefan Monnier  <address@hidden>
 
+       * emacs-lisp/edebug.el (edebug-enter): Don't mess with
+       overriding-local-map and pre/post-command-hook here.
+       (edebug-recursive-edit): Do it here instead (bug#12345).
+       (edebug-outside-unread-command-char): Remove all uses of
+       unread-command-char.
+
        * emacs-lisp/debug.el (debug): Don't bind debug-on-error since
        inhibit-debugger is bound instead.
 

=== modified file 'lisp/emacs-lisp/edebug.el'
--- a/lisp/emacs-lisp/edebug.el 2012-08-15 16:29:11 +0000
+++ b/lisp/emacs-lisp/edebug.el 2012-09-12 13:12:48 +0000
@@ -2248,47 +2248,14 @@
            (debug-on-quit edebug-on-quit)
 
            ;; Lexical bindings must be uncompiled for this to work.
-           (cl-lexical-debug t)
-
-           (edebug-outside-overriding-local-map overriding-local-map)
-           (edebug-outside-overriding-terminal-local-map
-            overriding-terminal-local-map)
-
-           ;; Save the outside value of executing macro.  (here??)
-           (edebug-outside-executing-macro executing-kbd-macro)
-           (edebug-outside-pre-command-hook
-            (edebug-var-status 'pre-command-hook))
-           (edebug-outside-post-command-hook
-            (edebug-var-status 'post-command-hook)))
+           (cl-lexical-debug t))
        (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-kbd-macro
-                  (if edebug-continue-kbd-macro executing-kbd-macro))
-
-                 ;; Don't get confused by the user's keymap changes.
-                 (overriding-local-map nil)
-                 (overriding-terminal-local-map nil)
-
-                 (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))
+           (let ((signal-hook-function 'edebug-signal))
              (setq edebug-execution-mode (or edebug-next-execution-mode
                                              edebug-initial-mode
                                              edebug-execution-mode)
                    edebug-next-execution-mode nil)
-             (edebug-enter edebug-function edebug-args edebug-body))
-         ;; Reset global variables in case outside value was changed.
-         (setq executing-kbd-macro edebug-outside-executing-macro)
-         (edebug-restore-status
-          'post-command-hook edebug-outside-post-command-hook)
-         (edebug-restore-status
-          'pre-command-hook edebug-outside-pre-command-hook)))
+             (edebug-enter edebug-function edebug-args edebug-body))))
 
     (let* ((edebug-data (get edebug-function 'edebug))
           (edebug-def-mark (car edebug-data)) ; mark at def start
@@ -2804,7 +2771,6 @@
 ;; in versions where the variable is *not* built-in.
 
 ;; Emacs 18  FIXME
-(defvar edebug-outside-unread-command-char)
 
 ;; Emacs 19.
 (defvar edebug-outside-last-command-event)
@@ -2814,15 +2780,6 @@
 (defvar edebug-outside-last-nonmenu-event)
 (defvar edebug-outside-track-mouse)
 
-;; Disable byte compiler warnings about unread-command-char and -event
-;; (maybe works with byte-compile-version 2.22 at least)
-(defvar edebug-unread-command-char-warning)
-(defvar edebug-unread-command-event-warning)
-(eval-when-compile                     ; FIXME
-  (setq edebug-unread-command-char-warning
-       (get 'unread-command-char 'byte-obsolete-variable))
-  (put 'unread-command-char 'byte-obsolete-variable nil))
-
 (defun edebug-recursive-edit ()
   ;; Start up a recursive edit inside of edebug.
   ;; The current buffer is the edebug-buffer, which is put into edebug-mode.
@@ -2844,14 +2801,24 @@
 
        (edebug-outside-map (current-local-map))
 
-       (edebug-outside-standard-output standard-output)
+        (edebug-outside-overriding-local-map overriding-local-map)
+        (edebug-outside-overriding-terminal-local-map
+         overriding-terminal-local-map)
+
+        ;; Save the outside value of executing macro.  (here??)
+        (edebug-outside-executing-macro executing-kbd-macro)
+        (edebug-outside-pre-command-hook
+         (edebug-var-status 'pre-command-hook))
+        (edebug-outside-post-command-hook
+         (edebug-var-status 'post-command-hook))
+
+        (edebug-outside-standard-output standard-output)
        (edebug-outside-standard-input standard-input)
        (edebug-outside-defining-kbd-macro defining-kbd-macro)
 
        (edebug-outside-last-command last-command)
        (edebug-outside-this-command this-command)
 
-       (edebug-outside-unread-command-char unread-command-char) ; FIXME
        (edebug-outside-current-prefix-arg current-prefix-arg)
 
        (edebug-outside-last-input-event last-input-event)
@@ -2867,9 +2834,6 @@
              ;; We could set these to the values for previous edebug call.
              (last-command last-command)
              (this-command this-command)
-
-             ;; Assume no edebug command sets unread-command-char.
-             (unread-command-char -1)
              (current-prefix-arg nil)
 
              ;; More for Emacs 19
@@ -2879,7 +2843,17 @@
              (last-nonmenu-event nil)
              (track-mouse nil)
 
-             ;; Bind again to outside values.
+             ;; 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-kbd-macro
+               (if edebug-continue-kbd-macro executing-kbd-macro))
+
+              ;; Don't get confused by the user's keymap changes.
+              (overriding-local-map nil)
+              (overriding-terminal-local-map nil)
+
+                 ;; Bind again to outside values.
              (debug-on-error edebug-outside-debug-on-error)
              (debug-on-quit edebug-outside-debug-on-quit)
 
@@ -2887,6 +2861,12 @@
              (defining-kbd-macro
                (if edebug-continue-kbd-macro defining-kbd-macro))
 
+             ;; 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)
+
              ;; others??
              )
 
@@ -2933,7 +2913,6 @@
        last-command-event edebug-outside-last-command-event
        last-command edebug-outside-last-command
        this-command edebug-outside-this-command
-       unread-command-char edebug-outside-unread-command-char
        current-prefix-arg edebug-outside-current-prefix-arg
        last-input-event edebug-outside-last-input-event
        last-event-frame edebug-outside-last-event-frame
@@ -2942,9 +2921,13 @@
 
        standard-output edebug-outside-standard-output
        standard-input edebug-outside-standard-input
-       defining-kbd-macro edebug-outside-defining-kbd-macro
-       ))
-    ))
+       defining-kbd-macro edebug-outside-defining-kbd-macro)
+
+      (setq executing-kbd-macro edebug-outside-executing-macro)
+      (edebug-restore-status
+       'post-command-hook edebug-outside-post-command-hook)
+      (edebug-restore-status
+       'pre-command-hook edebug-outside-pre-command-hook))))
 
 
 ;;; Display related functions
@@ -3562,7 +3545,6 @@
           (last-command-event edebug-outside-last-command-event)
           (last-command edebug-outside-last-command)
           (this-command edebug-outside-this-command)
-          (unread-command-char edebug-outside-unread-command-char)
           (unread-command-events edebug-outside-unread-command-events)
           (current-prefix-arg edebug-outside-current-prefix-arg)
           (last-input-event edebug-outside-last-input-event)
@@ -3602,7 +3584,6 @@
          edebug-outside-last-command-event last-command-event
          edebug-outside-last-command last-command
          edebug-outside-this-command this-command
-         edebug-outside-unread-command-char unread-command-char
          edebug-outside-unread-command-events unread-command-events
          edebug-outside-current-prefix-arg current-prefix-arg
          edebug-outside-last-input-event last-input-event
@@ -4240,7 +4221,7 @@
   (let ((buffer-read-only nil))
     (undo-boundary)
     (edebug-display-freq-count)
-    (setq unread-command-char (read-char))
+    (setq unread-command-events (append unread-command-events (read-event)))
     ;; Yuck!  This doesn't seem to work at all for me.
     (undo)))
 
@@ -4357,13 +4338,6 @@
 ;; Extension for bytecomp to resolve undefined function references.
 ;; Requires new byte compiler.
 
-;; Reenable byte compiler warnings about unread-command-char and -event.
-;; Disabled before edebug-recursive-edit.
-(eval-when-compile
-  (if edebug-unread-command-char-warning
-      (put 'unread-command-char 'byte-obsolete-variable
-          edebug-unread-command-char-warning)))
-
 (eval-when-compile
   ;; The body of eval-when-compile seems to get evaluated with eval-defun.
   ;; We only want to evaluate when actually byte compiling.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]