diff options
| author | Stefan Monnier | 2001-11-17 00:51:55 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-11-17 00:51:55 +0000 |
| commit | 0b936a1e08fa024a88a1cad194ae6d11fc6a4546 (patch) | |
| tree | 4f357ac291ea370edbd0dc759b31880eb6a1c3f6 | |
| parent | 08171162f7cb81d451752621cec46b898212c1ad (diff) | |
| download | emacs-0b936a1e08fa024a88a1cad194ae6d11fc6a4546.tar.gz emacs-0b936a1e08fa024a88a1cad194ae6d11fc6a4546.zip | |
(edebug-form-data, edebug-offsets)
(edebug-offsets-stack, edebug-read-dotted-list, edebug-def-name)
(edebug-current-offset, edebug-old-def-name, edebug-error-point)
(edebug-best-error): Don't defconst a variable.
(edebug-read-syntax-table): Use a char-table.
(edebug-lemacs-specific): Remove.
Toplevel: Eliminate check for Lucid Emacs.
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 100 |
1 files changed, 12 insertions, 88 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index ea44471a12c..eb06c6128a7 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -593,7 +593,7 @@ or if an error occurs, leave point after it with mark at the original point." | |||
| 593 | 593 | ||
| 594 | (make-variable-buffer-local 'edebug-form-data) | 594 | (make-variable-buffer-local 'edebug-form-data) |
| 595 | 595 | ||
| 596 | (defconst edebug-form-data nil) | 596 | (defvar edebug-form-data nil) |
| 597 | ;; A list of entries associating symbols with buffer regions. | 597 | ;; A list of entries associating symbols with buffer regions. |
| 598 | ;; This is an automatic buffer local variable. Each entry looks like: | 598 | ;; This is an automatic buffer local variable. Each entry looks like: |
| 599 | ;; @code{(@var{symbol} @var{begin-marker} @var{end-marker}). The markers | 599 | ;; @code{(@var{symbol} @var{begin-marker} @var{end-marker}). The markers |
| @@ -680,7 +680,7 @@ or if an error occurs, leave point after it with mark at the original point." | |||
| 680 | (defconst edebug-read-syntax-table | 680 | (defconst edebug-read-syntax-table |
| 681 | ;; Lookup table for significant characters indicating the class of the | 681 | ;; Lookup table for significant characters indicating the class of the |
| 682 | ;; token that follows. This is not a \"real\" syntax table. | 682 | ;; token that follows. This is not a \"real\" syntax table. |
| 683 | (let ((table (make-vector 256 'symbol)) | 683 | (let ((table (make-char-table 'syntax-table 'symbol)) |
| 684 | (i 0)) | 684 | (i 0)) |
| 685 | (while (< i ?!) | 685 | (while (< i ?!) |
| 686 | (aset table i 'space) | 686 | (aset table i 'space) |
| @@ -753,17 +753,17 @@ or if an error occurs, leave point after it with mark at the original point." | |||
| 753 | ;; or for structures that have elements: (before <subexpressions> . after) | 753 | ;; or for structures that have elements: (before <subexpressions> . after) |
| 754 | ;; where the <subexpressions> are the offset structures for subexpressions | 754 | ;; where the <subexpressions> are the offset structures for subexpressions |
| 755 | ;; including the head of a list. | 755 | ;; including the head of a list. |
| 756 | (defconst edebug-offsets nil) | 756 | (defvar edebug-offsets nil) |
| 757 | 757 | ||
| 758 | ;; Stack of offset structures in reverse order of the nesting. | 758 | ;; Stack of offset structures in reverse order of the nesting. |
| 759 | ;; This is used to get back to previous levels. | 759 | ;; This is used to get back to previous levels. |
| 760 | (defconst edebug-offsets-stack nil) | 760 | (defvar edebug-offsets-stack nil) |
| 761 | (defconst edebug-current-offset nil) ; Top of the stack, for convenience. | 761 | (defvar edebug-current-offset nil) ; Top of the stack, for convenience. |
| 762 | 762 | ||
| 763 | ;; We must store whether we just read a list with a dotted form that | 763 | ;; We must store whether we just read a list with a dotted form that |
| 764 | ;; is itself a list. This structure will be condensed, so the offsets | 764 | ;; is itself a list. This structure will be condensed, so the offsets |
| 765 | ;; must also be condensed. | 765 | ;; must also be condensed. |
| 766 | (defconst edebug-read-dotted-list nil) | 766 | (defvar edebug-read-dotted-list nil) |
| 767 | 767 | ||
| 768 | (defsubst edebug-initialize-offsets () | 768 | (defsubst edebug-initialize-offsets () |
| 769 | ;; Reinitialize offset recording. | 769 | ;; Reinitialize offset recording. |
| @@ -1063,11 +1063,11 @@ This controls how we read comma constructs.") | |||
| 1063 | (defvar edebug-&rest) | 1063 | (defvar edebug-&rest) |
| 1064 | (defvar edebug-gate nil) ;; whether no-match forces an error. | 1064 | (defvar edebug-gate nil) ;; whether no-match forces an error. |
| 1065 | 1065 | ||
| 1066 | (defconst edebug-def-name nil) ; name of definition, used by interactive-form | 1066 | (defvar edebug-def-name nil) ; name of definition, used by interactive-form |
| 1067 | (defconst edebug-old-def-name nil) ; previous name of containing definition. | 1067 | (defvar edebug-old-def-name nil) ; previous name of containing definition. |
| 1068 | 1068 | ||
| 1069 | (defconst edebug-error-point nil) | 1069 | (defvar edebug-error-point nil) |
| 1070 | (defconst edebug-best-error nil) | 1070 | (defvar edebug-best-error nil) |
| 1071 | 1071 | ||
| 1072 | 1072 | ||
| 1073 | (defun edebug-read-and-maybe-wrap-form () | 1073 | (defun edebug-read-and-maybe-wrap-form () |
| @@ -2853,8 +2853,6 @@ MSG is printed after `::::} '." | |||
| 2853 | ;; others?? | 2853 | ;; others?? |
| 2854 | ) | 2854 | ) |
| 2855 | 2855 | ||
| 2856 | (if (fboundp 'zmacs-deactivate-region);; for lemacs | ||
| 2857 | (zmacs-deactivate-region)) | ||
| 2858 | (if (and (eq edebug-execution-mode 'go) | 2856 | (if (and (eq edebug-execution-mode 'go) |
| 2859 | (not (memq edebug-arg-mode '(after error)))) | 2857 | (not (memq edebug-arg-mode '(after error)))) |
| 2860 | (message "Break")) | 2858 | (message "Break")) |
| @@ -4328,83 +4326,9 @@ With prefix argument, make it a temporary breakpoint." | |||
| 4328 | 4326 | ||
| 4329 | ;; Epoch specific code was in a separate file: edebug-epoch.el. | 4327 | ;; Epoch specific code was in a separate file: edebug-epoch.el. |
| 4330 | 4328 | ||
| 4331 | ;; The byte-compiler will complain about changes in number of arguments | 4329 | (easy-menu-define edebug-menu edebug-mode-map "Edebug menus" edebug-mode-menus) |
| 4332 | ;; to functions like mark and read-from-minibuffer. These warnings | ||
| 4333 | ;; may be ignored because the right call should always be made. | ||
| 4334 | 4330 | ||
| 4335 | 4331 | (if (display-popup-menus-p) (x-popup-menu nil edebug-menu)) | |
| 4336 | (defun edebug-lemacs-specific () | ||
| 4337 | |||
| 4338 | ;; We need to bind zmacs-regions to nil around all calls to `mark' and | ||
| 4339 | ;; `mark-marker' but don't bind it to nil before entering a recursive edit, | ||
| 4340 | ;; that is, don't interfere with the binding the user might see while | ||
| 4341 | ;; executing a command. | ||
| 4342 | |||
| 4343 | (defvar zmacs-regions) | ||
| 4344 | |||
| 4345 | (defun edebug-mark () | ||
| 4346 | (let ((zmacs-regions nil)) | ||
| 4347 | (mark))) | ||
| 4348 | |||
| 4349 | (defun edebug-window-live-p (window) | ||
| 4350 | "Return non-nil if WINDOW is visible." | ||
| 4351 | (get-window-with-predicate (lambda (w) (eq w window)))) | ||
| 4352 | |||
| 4353 | (defun edebug-mark-marker () | ||
| 4354 | (let ((zmacs-regions nil));; for lemacs | ||
| 4355 | (mark-marker))) | ||
| 4356 | |||
| 4357 | ;; no read-expression-history | ||
| 4358 | (defun edebug-set-conditional-breakpoint (arg condition) | ||
| 4359 | "Set a conditional breakpoint at nearest sexp. | ||
| 4360 | The condition is evaluated in the outside context. | ||
| 4361 | With prefix argument, make it a temporary breakpoint." | ||
| 4362 | ;; (interactive "P\nxCondition: ") | ||
| 4363 | (interactive | ||
| 4364 | (list | ||
| 4365 | current-prefix-arg | ||
| 4366 | ;; Edit previous condition as follows, but it is cumbersome: | ||
| 4367 | (let ((edebug-stop-point (edebug-find-stop-point))) | ||
| 4368 | (if edebug-stop-point | ||
| 4369 | (let* ((edebug-def-name (car edebug-stop-point)) | ||
| 4370 | (index (cdr edebug-stop-point)) | ||
| 4371 | (edebug-data (get edebug-def-name 'edebug)) | ||
| 4372 | (edebug-breakpoints (car (cdr edebug-data))) | ||
| 4373 | (edebug-break-data (assq index edebug-breakpoints)) | ||
| 4374 | (edebug-break-condition (car (cdr edebug-break-data)))) | ||
| 4375 | (read-minibuffer | ||
| 4376 | (format "Condition in %s: " edebug-def-name) | ||
| 4377 | (if edebug-break-condition | ||
| 4378 | (format "%s" edebug-break-condition) | ||
| 4379 | (format "")))))))) | ||
| 4380 | (edebug-modify-breakpoint t condition arg)) | ||
| 4381 | |||
| 4382 | (defun edebug-eval-expression (edebug-expr) | ||
| 4383 | "Evaluate an expression in the outside environment. | ||
| 4384 | If interactive, prompt for the expression. | ||
| 4385 | Print result in minibuffer." | ||
| 4386 | (interactive "xEval: ") | ||
| 4387 | (princ | ||
| 4388 | (edebug-outside-excursion | ||
| 4389 | (setq values (cons (edebug-eval edebug-expr) values)) | ||
| 4390 | (edebug-safe-prin1-to-string (car values))))) | ||
| 4391 | |||
| 4392 | (defun edebug-mode-menu (event) | ||
| 4393 | (interactive "@event") | ||
| 4394 | (popup-menu edebug-mode-menus)) | ||
| 4395 | |||
| 4396 | (define-key edebug-mode-map 'button3 'edebug-mode-menu) | ||
| 4397 | ) | ||
| 4398 | |||
| 4399 | (cond | ||
| 4400 | ((string-match "Lucid" emacs-version) ;; Lucid Emacs | ||
| 4401 | (edebug-lemacs-specific)) | ||
| 4402 | (t | ||
| 4403 | |||
| 4404 | (easy-menu-define edebug-menu edebug-mode-map "Edebug menus" edebug-mode-menus) | ||
| 4405 | |||
| 4406 | (if (display-popup-menus-p) | ||
| 4407 | (x-popup-menu nil (lookup-key edebug-mode-map [menu-bar Edebug]))))) | ||
| 4408 | 4332 | ||
| 4409 | ;;; Byte-compiler | 4333 | ;;; Byte-compiler |
| 4410 | 4334 | ||