diff options
| author | Stefan Monnier | 2012-09-12 09:12:48 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-09-12 09:12:48 -0400 |
| commit | 60c49c0fe92cde4e9f4d2db0ee15e55b7c7aa1cb (patch) | |
| tree | 55893490e07c42191130fcf275117670d244fe1a | |
| parent | 45b82ad0ebedaa1b7094912e218bea1510c33feb (diff) | |
| download | emacs-60c49c0fe92cde4e9f4d2db0ee15e55b7c7aa1cb.tar.gz emacs-60c49c0fe92cde4e9f4d2db0ee15e55b7c7aa1cb.zip | |
* 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.
Fixes: debbugs:12345
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 106 |
2 files changed, 46 insertions, 66 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 202b41891eb..f24ccb3aaa6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * emacs-lisp/edebug.el (edebug-enter): Don't mess with | ||
| 4 | overriding-local-map and pre/post-command-hook here. | ||
| 5 | (edebug-recursive-edit): Do it here instead (bug#12345). | ||
| 6 | (edebug-outside-unread-command-char): Remove all uses of | ||
| 7 | unread-command-char. | ||
| 8 | |||
| 3 | * emacs-lisp/debug.el (debug): Don't bind debug-on-error since | 9 | * emacs-lisp/debug.el (debug): Don't bind debug-on-error since |
| 4 | inhibit-debugger is bound instead. | 10 | inhibit-debugger is bound instead. |
| 5 | 11 | ||
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 7fcd339d6d2..17f6f79cd66 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -2248,47 +2248,14 @@ error is signaled again. | |||
| 2248 | (debug-on-quit edebug-on-quit) | 2248 | (debug-on-quit edebug-on-quit) |
| 2249 | 2249 | ||
| 2250 | ;; Lexical bindings must be uncompiled for this to work. | 2250 | ;; Lexical bindings must be uncompiled for this to work. |
| 2251 | (cl-lexical-debug t) | 2251 | (cl-lexical-debug t)) |
| 2252 | |||
| 2253 | (edebug-outside-overriding-local-map overriding-local-map) | ||
| 2254 | (edebug-outside-overriding-terminal-local-map | ||
| 2255 | overriding-terminal-local-map) | ||
| 2256 | |||
| 2257 | ;; Save the outside value of executing macro. (here??) | ||
| 2258 | (edebug-outside-executing-macro executing-kbd-macro) | ||
| 2259 | (edebug-outside-pre-command-hook | ||
| 2260 | (edebug-var-status 'pre-command-hook)) | ||
| 2261 | (edebug-outside-post-command-hook | ||
| 2262 | (edebug-var-status 'post-command-hook))) | ||
| 2263 | (unwind-protect | 2252 | (unwind-protect |
| 2264 | (let (;; Don't keep reading from an executing kbd macro | 2253 | (let ((signal-hook-function 'edebug-signal)) |
| 2265 | ;; within edebug unless edebug-continue-kbd-macro is | ||
| 2266 | ;; non-nil. Again, local binding may not be best. | ||
| 2267 | (executing-kbd-macro | ||
| 2268 | (if edebug-continue-kbd-macro executing-kbd-macro)) | ||
| 2269 | |||
| 2270 | ;; Don't get confused by the user's keymap changes. | ||
| 2271 | (overriding-local-map nil) | ||
| 2272 | (overriding-terminal-local-map nil) | ||
| 2273 | |||
| 2274 | (signal-hook-function 'edebug-signal) | ||
| 2275 | |||
| 2276 | ;; Disable command hooks. This is essential when | ||
| 2277 | ;; a hook function is instrumented - to avoid infinite loop. | ||
| 2278 | ;; This may be more than we need, however. | ||
| 2279 | (pre-command-hook nil) | ||
| 2280 | (post-command-hook nil)) | ||
| 2281 | (setq edebug-execution-mode (or edebug-next-execution-mode | 2254 | (setq edebug-execution-mode (or edebug-next-execution-mode |
| 2282 | edebug-initial-mode | 2255 | edebug-initial-mode |
| 2283 | edebug-execution-mode) | 2256 | edebug-execution-mode) |
| 2284 | edebug-next-execution-mode nil) | 2257 | edebug-next-execution-mode nil) |
| 2285 | (edebug-enter edebug-function edebug-args edebug-body)) | 2258 | (edebug-enter edebug-function edebug-args edebug-body)))) |
| 2286 | ;; Reset global variables in case outside value was changed. | ||
| 2287 | (setq executing-kbd-macro edebug-outside-executing-macro) | ||
| 2288 | (edebug-restore-status | ||
| 2289 | 'post-command-hook edebug-outside-post-command-hook) | ||
| 2290 | (edebug-restore-status | ||
| 2291 | 'pre-command-hook edebug-outside-pre-command-hook))) | ||
| 2292 | 2259 | ||
| 2293 | (let* ((edebug-data (get edebug-function 'edebug)) | 2260 | (let* ((edebug-data (get edebug-function 'edebug)) |
| 2294 | (edebug-def-mark (car edebug-data)) ; mark at def start | 2261 | (edebug-def-mark (car edebug-data)) ; mark at def start |
| @@ -2804,7 +2771,6 @@ MSG is printed after `::::} '." | |||
| 2804 | ;; in versions where the variable is *not* built-in. | 2771 | ;; in versions where the variable is *not* built-in. |
| 2805 | 2772 | ||
| 2806 | ;; Emacs 18 FIXME | 2773 | ;; Emacs 18 FIXME |
| 2807 | (defvar edebug-outside-unread-command-char) | ||
| 2808 | 2774 | ||
| 2809 | ;; Emacs 19. | 2775 | ;; Emacs 19. |
| 2810 | (defvar edebug-outside-last-command-event) | 2776 | (defvar edebug-outside-last-command-event) |
| @@ -2814,15 +2780,6 @@ MSG is printed after `::::} '." | |||
| 2814 | (defvar edebug-outside-last-nonmenu-event) | 2780 | (defvar edebug-outside-last-nonmenu-event) |
| 2815 | (defvar edebug-outside-track-mouse) | 2781 | (defvar edebug-outside-track-mouse) |
| 2816 | 2782 | ||
| 2817 | ;; Disable byte compiler warnings about unread-command-char and -event | ||
| 2818 | ;; (maybe works with byte-compile-version 2.22 at least) | ||
| 2819 | (defvar edebug-unread-command-char-warning) | ||
| 2820 | (defvar edebug-unread-command-event-warning) | ||
| 2821 | (eval-when-compile ; FIXME | ||
| 2822 | (setq edebug-unread-command-char-warning | ||
| 2823 | (get 'unread-command-char 'byte-obsolete-variable)) | ||
| 2824 | (put 'unread-command-char 'byte-obsolete-variable nil)) | ||
| 2825 | |||
| 2826 | (defun edebug-recursive-edit () | 2783 | (defun edebug-recursive-edit () |
| 2827 | ;; Start up a recursive edit inside of edebug. | 2784 | ;; Start up a recursive edit inside of edebug. |
| 2828 | ;; The current buffer is the edebug-buffer, which is put into edebug-mode. | 2785 | ;; The current buffer is the edebug-buffer, which is put into edebug-mode. |
| @@ -2844,14 +2801,24 @@ MSG is printed after `::::} '." | |||
| 2844 | 2801 | ||
| 2845 | (edebug-outside-map (current-local-map)) | 2802 | (edebug-outside-map (current-local-map)) |
| 2846 | 2803 | ||
| 2847 | (edebug-outside-standard-output standard-output) | 2804 | (edebug-outside-overriding-local-map overriding-local-map) |
| 2805 | (edebug-outside-overriding-terminal-local-map | ||
| 2806 | overriding-terminal-local-map) | ||
| 2807 | |||
| 2808 | ;; Save the outside value of executing macro. (here??) | ||
| 2809 | (edebug-outside-executing-macro executing-kbd-macro) | ||
| 2810 | (edebug-outside-pre-command-hook | ||
| 2811 | (edebug-var-status 'pre-command-hook)) | ||
| 2812 | (edebug-outside-post-command-hook | ||
| 2813 | (edebug-var-status 'post-command-hook)) | ||
| 2814 | |||
| 2815 | (edebug-outside-standard-output standard-output) | ||
| 2848 | (edebug-outside-standard-input standard-input) | 2816 | (edebug-outside-standard-input standard-input) |
| 2849 | (edebug-outside-defining-kbd-macro defining-kbd-macro) | 2817 | (edebug-outside-defining-kbd-macro defining-kbd-macro) |
| 2850 | 2818 | ||
| 2851 | (edebug-outside-last-command last-command) | 2819 | (edebug-outside-last-command last-command) |
| 2852 | (edebug-outside-this-command this-command) | 2820 | (edebug-outside-this-command this-command) |
| 2853 | 2821 | ||
| 2854 | (edebug-outside-unread-command-char unread-command-char) ; FIXME | ||
| 2855 | (edebug-outside-current-prefix-arg current-prefix-arg) | 2822 | (edebug-outside-current-prefix-arg current-prefix-arg) |
| 2856 | 2823 | ||
| 2857 | (edebug-outside-last-input-event last-input-event) | 2824 | (edebug-outside-last-input-event last-input-event) |
| @@ -2867,9 +2834,6 @@ MSG is printed after `::::} '." | |||
| 2867 | ;; We could set these to the values for previous edebug call. | 2834 | ;; We could set these to the values for previous edebug call. |
| 2868 | (last-command last-command) | 2835 | (last-command last-command) |
| 2869 | (this-command this-command) | 2836 | (this-command this-command) |
| 2870 | |||
| 2871 | ;; Assume no edebug command sets unread-command-char. | ||
| 2872 | (unread-command-char -1) | ||
| 2873 | (current-prefix-arg nil) | 2837 | (current-prefix-arg nil) |
| 2874 | 2838 | ||
| 2875 | ;; More for Emacs 19 | 2839 | ;; More for Emacs 19 |
| @@ -2879,7 +2843,17 @@ MSG is printed after `::::} '." | |||
| 2879 | (last-nonmenu-event nil) | 2843 | (last-nonmenu-event nil) |
| 2880 | (track-mouse nil) | 2844 | (track-mouse nil) |
| 2881 | 2845 | ||
| 2882 | ;; Bind again to outside values. | 2846 | ;; Don't keep reading from an executing kbd macro |
| 2847 | ;; within edebug unless edebug-continue-kbd-macro is | ||
| 2848 | ;; non-nil. Again, local binding may not be best. | ||
| 2849 | (executing-kbd-macro | ||
| 2850 | (if edebug-continue-kbd-macro executing-kbd-macro)) | ||
| 2851 | |||
| 2852 | ;; Don't get confused by the user's keymap changes. | ||
| 2853 | (overriding-local-map nil) | ||
| 2854 | (overriding-terminal-local-map nil) | ||
| 2855 | |||
| 2856 | ;; Bind again to outside values. | ||
| 2883 | (debug-on-error edebug-outside-debug-on-error) | 2857 | (debug-on-error edebug-outside-debug-on-error) |
| 2884 | (debug-on-quit edebug-outside-debug-on-quit) | 2858 | (debug-on-quit edebug-outside-debug-on-quit) |
| 2885 | 2859 | ||
| @@ -2887,6 +2861,12 @@ MSG is printed after `::::} '." | |||
| 2887 | (defining-kbd-macro | 2861 | (defining-kbd-macro |
| 2888 | (if edebug-continue-kbd-macro defining-kbd-macro)) | 2862 | (if edebug-continue-kbd-macro defining-kbd-macro)) |
| 2889 | 2863 | ||
| 2864 | ;; Disable command hooks. This is essential when | ||
| 2865 | ;; a hook function is instrumented - to avoid infinite loop. | ||
| 2866 | ;; This may be more than we need, however. | ||
| 2867 | (pre-command-hook nil) | ||
| 2868 | (post-command-hook nil) | ||
| 2869 | |||
| 2890 | ;; others?? | 2870 | ;; others?? |
| 2891 | ) | 2871 | ) |
| 2892 | 2872 | ||
| @@ -2933,7 +2913,6 @@ MSG is printed after `::::} '." | |||
| 2933 | last-command-event edebug-outside-last-command-event | 2913 | last-command-event edebug-outside-last-command-event |
| 2934 | last-command edebug-outside-last-command | 2914 | last-command edebug-outside-last-command |
| 2935 | this-command edebug-outside-this-command | 2915 | this-command edebug-outside-this-command |
| 2936 | unread-command-char edebug-outside-unread-command-char | ||
| 2937 | current-prefix-arg edebug-outside-current-prefix-arg | 2916 | current-prefix-arg edebug-outside-current-prefix-arg |
| 2938 | last-input-event edebug-outside-last-input-event | 2917 | last-input-event edebug-outside-last-input-event |
| 2939 | last-event-frame edebug-outside-last-event-frame | 2918 | last-event-frame edebug-outside-last-event-frame |
| @@ -2942,9 +2921,13 @@ MSG is printed after `::::} '." | |||
| 2942 | 2921 | ||
| 2943 | standard-output edebug-outside-standard-output | 2922 | standard-output edebug-outside-standard-output |
| 2944 | standard-input edebug-outside-standard-input | 2923 | standard-input edebug-outside-standard-input |
| 2945 | defining-kbd-macro edebug-outside-defining-kbd-macro | 2924 | defining-kbd-macro edebug-outside-defining-kbd-macro) |
| 2946 | )) | 2925 | |
| 2947 | )) | 2926 | (setq executing-kbd-macro edebug-outside-executing-macro) |
| 2927 | (edebug-restore-status | ||
| 2928 | 'post-command-hook edebug-outside-post-command-hook) | ||
| 2929 | (edebug-restore-status | ||
| 2930 | 'pre-command-hook edebug-outside-pre-command-hook)))) | ||
| 2948 | 2931 | ||
| 2949 | 2932 | ||
| 2950 | ;;; Display related functions | 2933 | ;;; Display related functions |
| @@ -3562,7 +3545,6 @@ Return the result of the last expression." | |||
| 3562 | (last-command-event edebug-outside-last-command-event) | 3545 | (last-command-event edebug-outside-last-command-event) |
| 3563 | (last-command edebug-outside-last-command) | 3546 | (last-command edebug-outside-last-command) |
| 3564 | (this-command edebug-outside-this-command) | 3547 | (this-command edebug-outside-this-command) |
| 3565 | (unread-command-char edebug-outside-unread-command-char) | ||
| 3566 | (unread-command-events edebug-outside-unread-command-events) | 3548 | (unread-command-events edebug-outside-unread-command-events) |
| 3567 | (current-prefix-arg edebug-outside-current-prefix-arg) | 3549 | (current-prefix-arg edebug-outside-current-prefix-arg) |
| 3568 | (last-input-event edebug-outside-last-input-event) | 3550 | (last-input-event edebug-outside-last-input-event) |
| @@ -3602,7 +3584,6 @@ Return the result of the last expression." | |||
| 3602 | edebug-outside-last-command-event last-command-event | 3584 | edebug-outside-last-command-event last-command-event |
| 3603 | edebug-outside-last-command last-command | 3585 | edebug-outside-last-command last-command |
| 3604 | edebug-outside-this-command this-command | 3586 | edebug-outside-this-command this-command |
| 3605 | edebug-outside-unread-command-char unread-command-char | ||
| 3606 | edebug-outside-unread-command-events unread-command-events | 3587 | edebug-outside-unread-command-events unread-command-events |
| 3607 | edebug-outside-current-prefix-arg current-prefix-arg | 3588 | edebug-outside-current-prefix-arg current-prefix-arg |
| 3608 | edebug-outside-last-input-event last-input-event | 3589 | edebug-outside-last-input-event last-input-event |
| @@ -4240,7 +4221,7 @@ It is removed when you hit any char." | |||
| 4240 | (let ((buffer-read-only nil)) | 4221 | (let ((buffer-read-only nil)) |
| 4241 | (undo-boundary) | 4222 | (undo-boundary) |
| 4242 | (edebug-display-freq-count) | 4223 | (edebug-display-freq-count) |
| 4243 | (setq unread-command-char (read-char)) | 4224 | (setq unread-command-events (append unread-command-events (read-event))) |
| 4244 | ;; Yuck! This doesn't seem to work at all for me. | 4225 | ;; Yuck! This doesn't seem to work at all for me. |
| 4245 | (undo))) | 4226 | (undo))) |
| 4246 | 4227 | ||
| @@ -4357,13 +4338,6 @@ With prefix argument, make it a temporary breakpoint." | |||
| 4357 | ;; Extension for bytecomp to resolve undefined function references. | 4338 | ;; Extension for bytecomp to resolve undefined function references. |
| 4358 | ;; Requires new byte compiler. | 4339 | ;; Requires new byte compiler. |
| 4359 | 4340 | ||
| 4360 | ;; Reenable byte compiler warnings about unread-command-char and -event. | ||
| 4361 | ;; Disabled before edebug-recursive-edit. | ||
| 4362 | (eval-when-compile | ||
| 4363 | (if edebug-unread-command-char-warning | ||
| 4364 | (put 'unread-command-char 'byte-obsolete-variable | ||
| 4365 | edebug-unread-command-char-warning))) | ||
| 4366 | |||
| 4367 | (eval-when-compile | 4341 | (eval-when-compile |
| 4368 | ;; The body of eval-when-compile seems to get evaluated with eval-defun. | 4342 | ;; The body of eval-when-compile seems to get evaluated with eval-defun. |
| 4369 | ;; We only want to evaluate when actually byte compiling. | 4343 | ;; We only want to evaluate when actually byte compiling. |