diff options
| author | Joakim Verona | 2013-05-02 22:28:36 +0200 |
|---|---|---|
| committer | Joakim Verona | 2013-05-02 22:28:36 +0200 |
| commit | 3b2a9bcfc08c74d95f46d634fadc758decb1c2b0 (patch) | |
| tree | 75b8b4e8d49bbbce820764ef95e6d74f0701ea12 | |
| parent | 8d5d86c8d2f660bc35d0a97142ca24a18aa9a6d4 (diff) | |
| download | emacs-3b2a9bcfc08c74d95f46d634fadc758decb1c2b0.tar.gz emacs-3b2a9bcfc08c74d95f46d634fadc758decb1c2b0.zip | |
trunk versions tha were missed earlier
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-loaddefs.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 1 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 647 | ||||
| -rw-r--r-- | lisp/progmodes/octave.el | 37 | ||||
| -rwxr-xr-x | make-dist | 4 |
9 files changed, 287 insertions, 421 deletions
| @@ -1,7 +1,3 @@ | |||
| 1 | 2013-05-01 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * make-dist: Keep necessary restrictions on file access. | ||
| 4 | |||
| 5 | 2013-04-29 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2013-04-29 Paul Eggert <eggert@cs.ucla.edu> |
| 6 | 2 | ||
| 7 | Merge from gnulib, incorporating: | 3 | Merge from gnulib, incorporating: |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be8329a856c..2e02f567058 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,12 +1,3 @@ | |||
| 1 | 2013-05-01 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * progmodes/octave.el: Compatible with older emacs-24 releases. | ||
| 4 | (inferior-octave-has-built-in-variables): Remove. Buil-in | ||
| 5 | variables were removed from Octave in 2007. | ||
| 6 | (inferior-octave-startup): Fix uses. | ||
| 7 | (comint-line-beginning-position): Remove compatibility code for | ||
| 8 | emacs 21. | ||
| 9 | |||
| 10 | 2013-05-01 Juri Linkov <juri@jurta.org> | 1 | 2013-05-01 Juri Linkov <juri@jurta.org> |
| 11 | 2 | ||
| 12 | * isearch.el (isearch-forward, isearch-mode): Doc fix. (Bug#13923) | 3 | * isearch.el (isearch-forward, isearch-mode): Doc fix. (Bug#13923) |
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 9bd7dacb4f7..f3bf70b0190 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Dave Gillespie <daveg@synaptics.com> | 5 | ;; Author: Dave Gillespie <daveg@synaptics.com> |
| 6 | ;; Version: 2.02 | 6 | ;; Version: 1.0 |
| 7 | ;; Keywords: extensions | 7 | ;; Keywords: extensions |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 40dea8ddebf..8ab2abec67e 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el | |||
| @@ -267,7 +267,7 @@ including `cl-block' and `cl-eval-when'. | |||
| 267 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when | 267 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when |
| 268 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp | 268 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp |
| 269 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) | 269 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) |
| 270 | ;;;;;; "cl-macs" "cl-macs.el" "b36258e378f078d937e71b70b43fb532") | 270 | ;;;;;; "cl-macs" "cl-macs.el" "8a90c81a400a2846e7b4c3da07626d94") |
| 271 | ;;; Generated autoloads from cl-macs.el | 271 | ;;; Generated autoloads from cl-macs.el |
| 272 | 272 | ||
| 273 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ | 273 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ |
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 89d022ecced..e9cc200baaa 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -2801,4 +2801,3 @@ surrounded by (cl-block NAME ...). | |||
| 2801 | (provide 'cl-macs) | 2801 | (provide 'cl-macs) |
| 2802 | 2802 | ||
| 2803 | ;;; cl-macs.el ends here | 2803 | ;;; cl-macs.el ends here |
| 2804 | |||
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 9728dd71751..ea4d9511f9d 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> | 5 | ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
| 6 | ;; Keywords: extensions | 6 | ;; Keywords: extensions |
| 7 | ;; Version: 2.02 | 7 | |
| 8 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 9 | 9 | ||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify |
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index e91e0408481..867f079ce5f 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; edebug.el --- a source-level debugger for Emacs Lisp | 1 | ;;; edebug.el --- a source-level debugger for Emacs Lisp -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1988-1995, 1997, 1999-2013 Free Software Foundation, | 3 | ;; Copyright (C) 1988-1995, 1997, 1999-2013 Free Software Foundation, |
| 4 | ;; Inc. | 4 | ;; Inc. |
| @@ -236,7 +236,7 @@ If the result is non-nil, then break. Errors are ignored." | |||
| 236 | 236 | ||
| 237 | (defun get-edebug-spec (symbol) | 237 | (defun get-edebug-spec (symbol) |
| 238 | ;; Get the spec of symbol resolving all indirection. | 238 | ;; Get the spec of symbol resolving all indirection. |
| 239 | (let ((edebug-form-spec nil) | 239 | (let ((spec nil) |
| 240 | (indirect symbol)) | 240 | (indirect symbol)) |
| 241 | (while | 241 | (while |
| 242 | (progn | 242 | (progn |
| @@ -244,9 +244,8 @@ If the result is non-nil, then break. Errors are ignored." | |||
| 244 | (setq indirect | 244 | (setq indirect |
| 245 | (function-get indirect 'edebug-form-spec 'macro)))) | 245 | (function-get indirect 'edebug-form-spec 'macro)))) |
| 246 | ;; (edebug-trace "indirection: %s" edebug-form-spec) | 246 | ;; (edebug-trace "indirection: %s" edebug-form-spec) |
| 247 | (setq edebug-form-spec indirect)) | 247 | (setq spec indirect)) |
| 248 | edebug-form-spec | 248 | spec)) |
| 249 | )) | ||
| 250 | 249 | ||
| 251 | ;;;###autoload | 250 | ;;;###autoload |
| 252 | (defun edebug-basic-spec (spec) | 251 | (defun edebug-basic-spec (spec) |
| @@ -336,9 +335,7 @@ A lambda list keyword is a symbol that starts with `&'." | |||
| 336 | (lambda (e1 e2) | 335 | (lambda (e1 e2) |
| 337 | (funcall function (car e1) (car e2)))))) | 336 | (funcall function (car e1) (car e2)))))) |
| 338 | 337 | ||
| 339 | ;;(def-edebug-spec edebug-save-restriction t) | 338 | ;; Not used. |
| 340 | |||
| 341 | ;; Not used. If it is used, def-edebug-spec must be defined before use. | ||
| 342 | '(defmacro edebug-save-restriction (&rest body) | 339 | '(defmacro edebug-save-restriction (&rest body) |
| 343 | "Evaluate BODY while saving the current buffers restriction. | 340 | "Evaluate BODY while saving the current buffers restriction. |
| 344 | BODY may change buffer outside of current restriction, unlike | 341 | BODY may change buffer outside of current restriction, unlike |
| @@ -346,6 +343,7 @@ save-restriction. BODY may change the current buffer, | |||
| 346 | and the restriction will be restored to the original buffer, | 343 | and the restriction will be restored to the original buffer, |
| 347 | and the current buffer remains current. | 344 | and the current buffer remains current. |
| 348 | Return the result of the last expression in BODY." | 345 | Return the result of the last expression in BODY." |
| 346 | (declare (debug t)) | ||
| 349 | `(let ((edebug:s-r-beg (point-min-marker)) | 347 | `(let ((edebug:s-r-beg (point-min-marker)) |
| 350 | (edebug:s-r-end (point-max-marker))) | 348 | (edebug:s-r-end (point-max-marker))) |
| 351 | (unwind-protect | 349 | (unwind-protect |
| @@ -363,6 +361,7 @@ Return the result of the last expression in BODY." | |||
| 363 | ;; Select WINDOW if it is provided and still exists. Otherwise, | 361 | ;; Select WINDOW if it is provided and still exists. Otherwise, |
| 364 | ;; if buffer is currently shown in several windows, choose one. | 362 | ;; if buffer is currently shown in several windows, choose one. |
| 365 | ;; Otherwise, find a new window, possibly splitting one. | 363 | ;; Otherwise, find a new window, possibly splitting one. |
| 364 | ;; FIXME: We should probably just be using `pop-to-buffer'. | ||
| 366 | (setq window | 365 | (setq window |
| 367 | (cond | 366 | (cond |
| 368 | ((and (edebug-window-live-p window) | 367 | ((and (edebug-window-live-p window) |
| @@ -371,7 +370,7 @@ Return the result of the last expression in BODY." | |||
| 371 | ((eq (window-buffer (selected-window)) buffer) | 370 | ((eq (window-buffer (selected-window)) buffer) |
| 372 | ;; Selected window already displays BUFFER. | 371 | ;; Selected window already displays BUFFER. |
| 373 | (selected-window)) | 372 | (selected-window)) |
| 374 | ((edebug-get-buffer-window buffer)) | 373 | ((get-buffer-window buffer 0)) |
| 375 | ((one-window-p 'nomini) | 374 | ((one-window-p 'nomini) |
| 376 | ;; When there's one window only, split it. | 375 | ;; When there's one window only, split it. |
| 377 | (split-window (minibuffer-selected-window))) | 376 | (split-window (minibuffer-selected-window))) |
| @@ -441,18 +440,14 @@ Return the result of the last expression in BODY." | |||
| 441 | window-info) | 440 | window-info) |
| 442 | (set-window-configuration window-info))) | 441 | (set-window-configuration window-info))) |
| 443 | 442 | ||
| 444 | (defalias 'edebug-get-buffer-window 'get-buffer-window) | ||
| 445 | (defalias 'edebug-sit-for 'sit-for) | ||
| 446 | (defalias 'edebug-input-pending-p 'input-pending-p) | ||
| 447 | |||
| 448 | |||
| 449 | ;;; Redefine read and eval functions | 443 | ;;; Redefine read and eval functions |
| 450 | ;; read is redefined to maybe instrument forms. | 444 | ;; read is redefined to maybe instrument forms. |
| 451 | ;; eval-defun is redefined to check edebug-all-forms and edebug-all-defs. | 445 | ;; eval-defun is redefined to check edebug-all-forms and edebug-all-defs. |
| 452 | 446 | ||
| 453 | ;; Save the original read function | 447 | ;; Save the original read function |
| 454 | (or (fboundp 'edebug-original-read) | 448 | (defalias 'edebug-original-read |
| 455 | (defalias 'edebug-original-read (symbol-function 'read))) | 449 | (symbol-function (if (fboundp 'edebug-original-read) |
| 450 | 'edebug-original-read 'read))) | ||
| 456 | 451 | ||
| 457 | (defun edebug-read (&optional stream) | 452 | (defun edebug-read (&optional stream) |
| 458 | "Read one Lisp expression as text from STREAM, return as Lisp object. | 453 | "Read one Lisp expression as text from STREAM, return as Lisp object. |
| @@ -617,36 +612,29 @@ already is one.)" | |||
| 617 | ;; The internal data that is needed for edebugging is kept in the | 612 | ;; The internal data that is needed for edebugging is kept in the |
| 618 | ;; buffer-local variable `edebug-form-data'. | 613 | ;; buffer-local variable `edebug-form-data'. |
| 619 | 614 | ||
| 620 | (make-variable-buffer-local 'edebug-form-data) | 615 | (defvar-local edebug-form-data nil |
| 621 | 616 | "A list of entries associating symbols with buffer regions. | |
| 622 | (defvar edebug-form-data nil) | 617 | Each entry is an `edebug--form-data' struct with fields: |
| 623 | ;; A list of entries associating symbols with buffer regions. | 618 | SYMBOL, BEGIN-MARKER, and END-MARKER. The markers |
| 624 | ;; This is an automatic buffer local variable. Each entry looks like: | 619 | are at the beginning and end of an entry level form and SYMBOL is |
| 625 | ;; @code{(@var{symbol} @var{begin-marker} @var{end-marker}). The markers | 620 | a symbol that holds all edebug related information for the form on its |
| 626 | ;; are at the beginning and end of an entry level form and @var{symbol} is | 621 | property list. |
| 627 | ;; a symbol that holds all edebug related information for the form on its | 622 | |
| 628 | ;; property list. | 623 | In the future (haha!), the symbol will be irrelevant and edebug data will |
| 629 | 624 | be stored in the definitions themselves rather than in the property | |
| 630 | ;; In the future, the symbol will be irrelevant and edebug data will | 625 | list of a symbol.") |
| 631 | ;; be stored in the definitions themselves rather than in the property | 626 | |
| 632 | ;; list of a symbol. | 627 | (cl-defstruct (edebug--form-data |
| 633 | 628 | ;; Some callers expect accessors to return nil when passed nil. | |
| 634 | (defun edebug-make-form-data-entry (symbol begin end) | 629 | (:type list) |
| 635 | (list symbol begin end)) | 630 | (:constructor edebug--make-form-data-entry (name begin end)) |
| 636 | 631 | (:predicate nil) (:constructor nil) (:copier nil)) | |
| 637 | (defsubst edebug-form-data-name (entry) | 632 | name begin end) |
| 638 | (car entry)) | ||
| 639 | |||
| 640 | (defsubst edebug-form-data-begin (entry) | ||
| 641 | (nth 1 entry)) | ||
| 642 | |||
| 643 | (defsubst edebug-form-data-end (entry) | ||
| 644 | (nth 2 entry)) | ||
| 645 | 633 | ||
| 646 | (defsubst edebug-set-form-data-entry (entry name begin end) | 634 | (defsubst edebug-set-form-data-entry (entry name begin end) |
| 647 | (setcar entry name);; in case name is changed | 635 | (setf (edebug--form-data-name entry) name) ;; In case name is changed. |
| 648 | (set-marker (nth 1 entry) begin) | 636 | (set-marker (edebug--form-data-begin entry) begin) |
| 649 | (set-marker (nth 2 entry) end)) | 637 | (set-marker (edebug--form-data-end entry) end)) |
| 650 | 638 | ||
| 651 | (defun edebug-get-form-data-entry (pnt &optional end-point) | 639 | (defun edebug-get-form-data-entry (pnt &optional end-point) |
| 652 | ;; Find the edebug form data entry which is closest to PNT. | 640 | ;; Find the edebug form data entry which is closest to PNT. |
| @@ -654,17 +642,17 @@ already is one.)" | |||
| 654 | ;; Return `nil' if none found. | 642 | ;; Return `nil' if none found. |
| 655 | (let ((rest edebug-form-data) | 643 | (let ((rest edebug-form-data) |
| 656 | closest-entry | 644 | closest-entry |
| 657 | (closest-dist 999999)) ;; need maxint here | 645 | (closest-dist 999999)) ;; Need maxint here. |
| 658 | (while (and rest (< 0 closest-dist)) | 646 | (while (and rest (< 0 closest-dist)) |
| 659 | (let* ((entry (car rest)) | 647 | (let* ((entry (car rest)) |
| 660 | (begin (edebug-form-data-begin entry)) | 648 | (begin (edebug--form-data-begin entry)) |
| 661 | (dist (- pnt begin))) | 649 | (dist (- pnt begin))) |
| 662 | (setq rest (cdr rest)) | 650 | (setq rest (cdr rest)) |
| 663 | (if (and (<= 0 dist) | 651 | (if (and (<= 0 dist) |
| 664 | (< dist closest-dist) | 652 | (< dist closest-dist) |
| 665 | (or (not end-point) | 653 | (or (not end-point) |
| 666 | (= end-point (edebug-form-data-end entry))) | 654 | (= end-point (edebug--form-data-end entry))) |
| 667 | (<= pnt (edebug-form-data-end entry))) | 655 | (<= pnt (edebug--form-data-end entry))) |
| 668 | (setq closest-dist dist | 656 | (setq closest-dist dist |
| 669 | closest-entry entry)))) | 657 | closest-entry entry)))) |
| 670 | closest-entry)) | 658 | closest-entry)) |
| @@ -673,19 +661,19 @@ already is one.)" | |||
| 673 | ;; and find an entry given a symbol, which should be just assq. | 661 | ;; and find an entry given a symbol, which should be just assq. |
| 674 | 662 | ||
| 675 | (defun edebug-form-data-symbol () | 663 | (defun edebug-form-data-symbol () |
| 676 | ;; Return the edebug data symbol of the form where point is in. | 664 | "Return the edebug data symbol of the form where point is in. |
| 677 | ;; If point is not inside a edebuggable form, cause error. | 665 | If point is not inside a edebuggable form, cause error." |
| 678 | (or (edebug-form-data-name (edebug-get-form-data-entry (point))) | 666 | (or (edebug--form-data-name (edebug-get-form-data-entry (point))) |
| 679 | (error "Not inside instrumented form"))) | 667 | (error "Not inside instrumented form"))) |
| 680 | 668 | ||
| 681 | (defun edebug-make-top-form-data-entry (new-entry) | 669 | (defun edebug-make-top-form-data-entry (new-entry) |
| 682 | ;; Make NEW-ENTRY the first element in the `edebug-form-data' list. | 670 | ;; Make NEW-ENTRY the first element in the `edebug-form-data' list. |
| 683 | (edebug-clear-form-data-entry new-entry) | 671 | (edebug-clear-form-data-entry new-entry) |
| 684 | (setq edebug-form-data (cons new-entry edebug-form-data))) | 672 | (push new-entry edebug-form-data)) |
| 685 | 673 | ||
| 686 | (defun edebug-clear-form-data-entry (entry) | 674 | (defun edebug-clear-form-data-entry (entry) |
| 687 | ;; If non-nil, clear ENTRY out of the form data. | 675 | "If non-nil, clear ENTRY out of the form data. |
| 688 | ;; Maybe clear the markers and delete the symbol's edebug property? | 676 | Maybe clear the markers and delete the symbol's edebug property?" |
| 689 | (if entry | 677 | (if entry |
| 690 | (progn | 678 | (progn |
| 691 | ;; Instead of this, we could just find all contained forms. | 679 | ;; Instead of this, we could just find all contained forms. |
| @@ -1077,7 +1065,8 @@ already is one.)" | |||
| 1077 | ;; If it gets an error, make it nil. | 1065 | ;; If it gets an error, make it nil. |
| 1078 | (let ((temp-hook edebug-setup-hook)) | 1066 | (let ((temp-hook edebug-setup-hook)) |
| 1079 | (setq edebug-setup-hook nil) | 1067 | (setq edebug-setup-hook nil) |
| 1080 | (run-hooks 'temp-hook)) | 1068 | (if (functionp temp-hook) (funcall temp-hook) |
| 1069 | (mapc #'funcall temp-hook))) | ||
| 1081 | 1070 | ||
| 1082 | (let (result | 1071 | (let (result |
| 1083 | edebug-top-window-data | 1072 | edebug-top-window-data |
| @@ -1214,8 +1203,8 @@ already is one.)" | |||
| 1214 | (defvar edebug-offset-list) ; the list of offset positions. | 1203 | (defvar edebug-offset-list) ; the list of offset positions. |
| 1215 | 1204 | ||
| 1216 | (defun edebug-inc-offset (offset) | 1205 | (defun edebug-inc-offset (offset) |
| 1217 | ;; modifies edebug-offset-index and edebug-offset-list | 1206 | ;; Modifies edebug-offset-index and edebug-offset-list |
| 1218 | ;; accesses edebug-func-marc and buffer point | 1207 | ;; accesses edebug-func-marc and buffer point. |
| 1219 | (prog1 | 1208 | (prog1 |
| 1220 | edebug-offset-index | 1209 | edebug-offset-index |
| 1221 | (setq edebug-offset-list (cons (- offset edebug-form-begin-marker) | 1210 | (setq edebug-offset-list (cons (- offset edebug-form-begin-marker) |
| @@ -1228,13 +1217,11 @@ already is one.)" | |||
| 1228 | ;; given FORM. Looks like: | 1217 | ;; given FORM. Looks like: |
| 1229 | ;; (edebug-after (edebug-before BEFORE-INDEX) AFTER-INDEX FORM) | 1218 | ;; (edebug-after (edebug-before BEFORE-INDEX) AFTER-INDEX FORM) |
| 1230 | ;; Also increment the offset index for subsequent use. | 1219 | ;; Also increment the offset index for subsequent use. |
| 1231 | (list 'edebug-after | 1220 | `(edebug-after (edebug-before ,before-index) ,after-index ,form)) |
| 1232 | (list 'edebug-before before-index) | ||
| 1233 | after-index form)) | ||
| 1234 | 1221 | ||
| 1235 | (defun edebug-make-after-form (form after-index) | 1222 | (defun edebug-make-after-form (form after-index) |
| 1236 | ;; Like edebug-make-before-and-after-form, but only after. | 1223 | ;; Like edebug-make-before-and-after-form, but only after. |
| 1237 | (list 'edebug-after 0 after-index form)) | 1224 | `(edebug-after 0 ,after-index ,form)) |
| 1238 | 1225 | ||
| 1239 | 1226 | ||
| 1240 | (defun edebug-unwrap (sexp) | 1227 | (defun edebug-unwrap (sexp) |
| @@ -1284,7 +1271,7 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1284 | ;; Set this marker before parsing. | 1271 | ;; Set this marker before parsing. |
| 1285 | (edebug-form-begin-marker | 1272 | (edebug-form-begin-marker |
| 1286 | (if form-data-entry | 1273 | (if form-data-entry |
| 1287 | (edebug-form-data-begin form-data-entry) | 1274 | (edebug--form-data-begin form-data-entry) |
| 1288 | ;; Buffer must be current-buffer for this to work: | 1275 | ;; Buffer must be current-buffer for this to work: |
| 1289 | (set-marker (make-marker) form-begin)))) | 1276 | (set-marker (make-marker) form-begin)))) |
| 1290 | 1277 | ||
| @@ -1294,7 +1281,7 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1294 | ;; For definitions. | 1281 | ;; For definitions. |
| 1295 | ;; (edebug-containing-def-name edebug-def-name) | 1282 | ;; (edebug-containing-def-name edebug-def-name) |
| 1296 | ;; Get name from form-data, if any. | 1283 | ;; Get name from form-data, if any. |
| 1297 | (edebug-old-def-name (edebug-form-data-name form-data-entry)) | 1284 | (edebug-old-def-name (edebug--form-data-name form-data-entry)) |
| 1298 | edebug-def-name | 1285 | edebug-def-name |
| 1299 | edebug-def-args | 1286 | edebug-def-args |
| 1300 | edebug-def-interactive | 1287 | edebug-def-interactive |
| @@ -1324,7 +1311,7 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1324 | ;; In the latter case, pointers to the entry remain eq. | 1311 | ;; In the latter case, pointers to the entry remain eq. |
| 1325 | (if (not form-data-entry) | 1312 | (if (not form-data-entry) |
| 1326 | (setq form-data-entry | 1313 | (setq form-data-entry |
| 1327 | (edebug-make-form-data-entry | 1314 | (edebug--make-form-data-entry |
| 1328 | edebug-def-name | 1315 | edebug-def-name |
| 1329 | edebug-form-begin-marker | 1316 | edebug-form-begin-marker |
| 1330 | ;; Buffer must be current-buffer. | 1317 | ;; Buffer must be current-buffer. |
| @@ -1510,18 +1497,18 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1510 | ;; Otherwise it signals an error. The place of the error is found | 1497 | ;; Otherwise it signals an error. The place of the error is found |
| 1511 | ;; with the two before- and after-offset functions. | 1498 | ;; with the two before- and after-offset functions. |
| 1512 | 1499 | ||
| 1513 | (defun edebug-no-match (cursor &rest edebug-args) | 1500 | (defun edebug-no-match (cursor &rest args) |
| 1514 | ;; Throw a no-match, or signal an error immediately if gate is active. | 1501 | ;; Throw a no-match, or signal an error immediately if gate is active. |
| 1515 | ;; Remember this point in case we need to report this error. | 1502 | ;; Remember this point in case we need to report this error. |
| 1516 | (setq edebug-error-point (or edebug-error-point | 1503 | (setq edebug-error-point (or edebug-error-point |
| 1517 | (edebug-before-offset cursor)) | 1504 | (edebug-before-offset cursor)) |
| 1518 | edebug-best-error (or edebug-best-error edebug-args)) | 1505 | edebug-best-error (or edebug-best-error args)) |
| 1519 | (if (and edebug-gate (not edebug-&optional)) | 1506 | (if (and edebug-gate (not edebug-&optional)) |
| 1520 | (progn | 1507 | (progn |
| 1521 | (if edebug-error-point | 1508 | (if edebug-error-point |
| 1522 | (goto-char edebug-error-point)) | 1509 | (goto-char edebug-error-point)) |
| 1523 | (apply 'edebug-syntax-error edebug-args)) | 1510 | (apply 'edebug-syntax-error args)) |
| 1524 | (funcall 'throw 'no-match edebug-args))) | 1511 | (throw 'no-match args))) |
| 1525 | 1512 | ||
| 1526 | 1513 | ||
| 1527 | (defun edebug-match (cursor specs) | 1514 | (defun edebug-match (cursor specs) |
| @@ -1748,7 +1735,7 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1748 | specs)))) | 1735 | specs)))) |
| 1749 | 1736 | ||
| 1750 | 1737 | ||
| 1751 | (defun edebug-match-gate (cursor) | 1738 | (defun edebug-match-gate (_cursor) |
| 1752 | ;; Simply set the gate to prevent backtracking at this level. | 1739 | ;; Simply set the gate to prevent backtracking at this level. |
| 1753 | (setq edebug-gate t) | 1740 | (setq edebug-gate t) |
| 1754 | nil) | 1741 | nil) |
| @@ -1837,7 +1824,7 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1837 | nil)) | 1824 | nil)) |
| 1838 | 1825 | ||
| 1839 | 1826 | ||
| 1840 | (defun edebug-match-function (cursor) | 1827 | (defun edebug-match-function (_cursor) |
| 1841 | (error "Use function-form instead of function in edebug spec")) | 1828 | (error "Use function-form instead of function in edebug spec")) |
| 1842 | 1829 | ||
| 1843 | (defun edebug-match-&define (cursor specs) | 1830 | (defun edebug-match-&define (cursor specs) |
| @@ -1894,7 +1881,7 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1894 | (edebug-move-cursor cursor) | 1881 | (edebug-move-cursor cursor) |
| 1895 | (list name))) | 1882 | (list name))) |
| 1896 | 1883 | ||
| 1897 | (defun edebug-match-colon-name (cursor spec) | 1884 | (defun edebug-match-colon-name (_cursor spec) |
| 1898 | ;; Set the edebug-def-name to the spec. | 1885 | ;; Set the edebug-def-name to the spec. |
| 1899 | (setq edebug-def-name | 1886 | (setq edebug-def-name |
| 1900 | (if edebug-def-name | 1887 | (if edebug-def-name |
| @@ -1979,6 +1966,8 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 1979 | def-body)) | 1966 | def-body)) |
| 1980 | ;; FIXME? Isn't this missing the doc-string? Cf defun. | 1967 | ;; FIXME? Isn't this missing the doc-string? Cf defun. |
| 1981 | (def-edebug-spec defmacro | 1968 | (def-edebug-spec defmacro |
| 1969 | ;; FIXME: Improve `declare' so we can Edebug gv-expander and | ||
| 1970 | ;; gv-setter declarations. | ||
| 1982 | (&define name lambda-list [&optional ("declare" &rest sexp)] def-body)) | 1971 | (&define name lambda-list [&optional ("declare" &rest sexp)] def-body)) |
| 1983 | 1972 | ||
| 1984 | (def-edebug-spec arglist lambda-list) ;; deprecated - use lambda-list. | 1973 | (def-edebug-spec arglist lambda-list) ;; deprecated - use lambda-list. |
| @@ -2009,11 +1998,6 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 2009 | ;; (def-edebug-spec anonymous-form ((&or ["lambda" lambda] ["macro" macro]))) | 1998 | ;; (def-edebug-spec anonymous-form ((&or ["lambda" lambda] ["macro" macro]))) |
| 2010 | 1999 | ||
| 2011 | ;; Standard functions that take function-forms arguments. | 2000 | ;; Standard functions that take function-forms arguments. |
| 2012 | (def-edebug-spec mapcar (function-form form)) | ||
| 2013 | (def-edebug-spec mapconcat (function-form form form)) | ||
| 2014 | (def-edebug-spec mapatoms (function-form &optional form)) | ||
| 2015 | (def-edebug-spec apply (function-form &rest form)) | ||
| 2016 | (def-edebug-spec funcall (function-form &rest form)) | ||
| 2017 | 2001 | ||
| 2018 | ;; FIXME? The manual uses this form (maybe that's just for illustration?): | 2002 | ;; FIXME? The manual uses this form (maybe that's just for illustration?): |
| 2019 | ;; (def-edebug-spec let | 2003 | ;; (def-edebug-spec let |
| @@ -2079,49 +2063,12 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 2079 | &or ("quote" edebug-\`) def-form)) | 2063 | &or ("quote" edebug-\`) def-form)) |
| 2080 | 2064 | ||
| 2081 | ;; New byte compiler. | 2065 | ;; New byte compiler. |
| 2082 | (def-edebug-spec defsubst defun) | ||
| 2083 | (def-edebug-spec dont-compile t) | ||
| 2084 | (def-edebug-spec eval-when-compile t) | ||
| 2085 | (def-edebug-spec eval-and-compile t) | ||
| 2086 | 2066 | ||
| 2087 | (def-edebug-spec save-selected-window t) | 2067 | (def-edebug-spec save-selected-window t) |
| 2088 | (def-edebug-spec save-current-buffer t) | 2068 | (def-edebug-spec save-current-buffer t) |
| 2089 | (def-edebug-spec delay-mode-hooks t) | ||
| 2090 | (def-edebug-spec with-temp-file t) | ||
| 2091 | (def-edebug-spec with-temp-message t) | ||
| 2092 | (def-edebug-spec with-syntax-table t) | ||
| 2093 | (def-edebug-spec push (form sexp)) | ||
| 2094 | (def-edebug-spec pop (sexp)) | ||
| 2095 | |||
| 2096 | (def-edebug-spec 1value (form)) | ||
| 2097 | (def-edebug-spec noreturn (form)) | ||
| 2098 | |||
| 2099 | 2069 | ||
| 2100 | ;; Anything else? | 2070 | ;; Anything else? |
| 2101 | 2071 | ||
| 2102 | |||
| 2103 | ;; Some miscellaneous specs for macros in public packages. | ||
| 2104 | ;; Send me yours. | ||
| 2105 | |||
| 2106 | ;; advice.el by Hans Chalupsky (hans@cs.buffalo.edu) | ||
| 2107 | |||
| 2108 | (def-edebug-spec ad-dolist ((symbolp form &optional form) body)) | ||
| 2109 | (def-edebug-spec defadvice | ||
| 2110 | (&define name ;; thing being advised. | ||
| 2111 | (name ;; class is [&or "before" "around" "after" | ||
| 2112 | ;; "activation" "deactivation"] | ||
| 2113 | name ;; name of advice | ||
| 2114 | &rest sexp ;; optional position and flags | ||
| 2115 | ) | ||
| 2116 | [&optional stringp] | ||
| 2117 | [&optional ("interactive" interactive)] | ||
| 2118 | def-body)) | ||
| 2119 | |||
| 2120 | (def-edebug-spec easy-menu-define (symbolp body)) | ||
| 2121 | |||
| 2122 | (def-edebug-spec with-custom-print body) | ||
| 2123 | |||
| 2124 | |||
| 2125 | ;;; The debugger itself | 2072 | ;;; The debugger itself |
| 2126 | 2073 | ||
| 2127 | (defvar edebug-active nil) ;; Non-nil when edebug is active | 2074 | (defvar edebug-active nil) ;; Non-nil when edebug is active |
| @@ -2153,10 +2100,7 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 2153 | 2100 | ||
| 2154 | ;; Dynamically bound variables, declared globally but left unbound. | 2101 | ;; Dynamically bound variables, declared globally but left unbound. |
| 2155 | (defvar edebug-function) ; the function being executed. change name!! | 2102 | (defvar edebug-function) ; the function being executed. change name!! |
| 2156 | (defvar edebug-args) ; the arguments of the function | ||
| 2157 | (defvar edebug-data) ; the edebug data for the function | 2103 | (defvar edebug-data) ; the edebug data for the function |
| 2158 | (defvar edebug-value) ; the result of the expression | ||
| 2159 | (defvar edebug-after-index) | ||
| 2160 | (defvar edebug-def-mark) ; the mark for the definition | 2104 | (defvar edebug-def-mark) ; the mark for the definition |
| 2161 | (defvar edebug-freq-count) ; the count of expression visits. | 2105 | (defvar edebug-freq-count) ; the count of expression visits. |
| 2162 | (defvar edebug-coverage) ; the coverage results of each expression of function. | 2106 | (defvar edebug-coverage) ; the coverage results of each expression of function. |
| @@ -2172,8 +2116,6 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 2172 | (defvar edebug-outside-debug-on-error) ; the value of debug-on-error outside | 2116 | (defvar edebug-outside-debug-on-error) ; the value of debug-on-error outside |
| 2173 | (defvar edebug-outside-debug-on-quit) ; the value of debug-on-quit outside | 2117 | (defvar edebug-outside-debug-on-quit) ; the value of debug-on-quit outside |
| 2174 | 2118 | ||
| 2175 | (defvar edebug-outside-overriding-local-map) | ||
| 2176 | (defvar edebug-outside-overriding-terminal-local-map) | ||
| 2177 | 2119 | ||
| 2178 | (defvar edebug-outside-pre-command-hook) | 2120 | (defvar edebug-outside-pre-command-hook) |
| 2179 | (defvar edebug-outside-post-command-hook) | 2121 | (defvar edebug-outside-post-command-hook) |
| @@ -2182,7 +2124,7 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 2182 | 2124 | ||
| 2183 | ;;; Handling signals | 2125 | ;;; Handling signals |
| 2184 | 2126 | ||
| 2185 | (defun edebug-signal (edebug-signal-name edebug-signal-data) | 2127 | (defun edebug-signal (signal-name signal-data) |
| 2186 | "Signal an error. Args are SIGNAL-NAME, and associated DATA. | 2128 | "Signal an error. Args are SIGNAL-NAME, and associated DATA. |
| 2187 | A signal name is a symbol with an `error-conditions' property | 2129 | A signal name is a symbol with an `error-conditions' property |
| 2188 | that is a list of condition names. | 2130 | that is a list of condition names. |
| @@ -2196,19 +2138,18 @@ See `condition-case'. | |||
| 2196 | This is the Edebug replacement for the standard `signal'. It should | 2138 | This is the Edebug replacement for the standard `signal'. It should |
| 2197 | only be active while Edebug is. It checks `debug-on-error' to see | 2139 | only be active while Edebug is. It checks `debug-on-error' to see |
| 2198 | whether it should call the debugger. When execution is resumed, the | 2140 | whether it should call the debugger. When execution is resumed, the |
| 2199 | error is signaled again. | 2141 | error is signaled again." |
| 2200 | \n(fn SIGNAL-NAME DATA)" | 2142 | (if (and (listp debug-on-error) (memq signal-name debug-on-error)) |
| 2201 | (if (and (listp debug-on-error) (memq edebug-signal-name debug-on-error)) | 2143 | (edebug 'error (cons signal-name signal-data))) |
| 2202 | (edebug 'error (cons edebug-signal-name edebug-signal-data))) | ||
| 2203 | ;; If we reach here without another non-local exit, then send signal again. | 2144 | ;; If we reach here without another non-local exit, then send signal again. |
| 2204 | ;; i.e. the signal is not continuable, yet. | 2145 | ;; i.e. the signal is not continuable, yet. |
| 2205 | ;; Avoid infinite recursion. | 2146 | ;; Avoid infinite recursion. |
| 2206 | (let ((signal-hook-function nil)) | 2147 | (let ((signal-hook-function nil)) |
| 2207 | (signal edebug-signal-name edebug-signal-data))) | 2148 | (signal signal-name signal-data))) |
| 2208 | 2149 | ||
| 2209 | ;;; Entering Edebug | 2150 | ;;; Entering Edebug |
| 2210 | 2151 | ||
| 2211 | (defun edebug-enter (edebug-function edebug-args edebug-body) | 2152 | (defun edebug-enter (function args body) |
| 2212 | ;; Entering FUNC. The arguments are ARGS, and the body is BODY. | 2153 | ;; Entering FUNC. The arguments are ARGS, and the body is BODY. |
| 2213 | ;; Setup edebug variables and evaluate BODY. This function is called | 2154 | ;; Setup edebug variables and evaluate BODY. This function is called |
| 2214 | ;; when a function evaluated with edebug-eval-top-level-form is entered. | 2155 | ;; when a function evaluated with edebug-eval-top-level-form is entered. |
| @@ -2217,50 +2158,51 @@ error is signaled again. | |||
| 2217 | ;; Is this the first time we are entering edebug since | 2158 | ;; Is this the first time we are entering edebug since |
| 2218 | ;; lower-level recursive-edit command? | 2159 | ;; lower-level recursive-edit command? |
| 2219 | ;; More precisely, this tests whether Edebug is currently active. | 2160 | ;; More precisely, this tests whether Edebug is currently active. |
| 2220 | (if (not edebug-entered) | 2161 | (let ((edebug-function function)) |
| 2221 | (let ((edebug-entered t) | 2162 | (if (not edebug-entered) |
| 2222 | ;; Binding max-lisp-eval-depth here is OK, | 2163 | (let ((edebug-entered t) |
| 2223 | ;; but not inside an unwind-protect. | 2164 | ;; Binding max-lisp-eval-depth here is OK, |
| 2224 | ;; Doing it here also keeps it from growing too large. | 2165 | ;; but not inside an unwind-protect. |
| 2225 | (max-lisp-eval-depth (+ 100 max-lisp-eval-depth)) ; too much?? | 2166 | ;; Doing it here also keeps it from growing too large. |
| 2226 | (max-specpdl-size (+ 200 max-specpdl-size)) | 2167 | (max-lisp-eval-depth (+ 100 max-lisp-eval-depth)) ; too much?? |
| 2227 | 2168 | (max-specpdl-size (+ 200 max-specpdl-size)) | |
| 2228 | (debugger edebug-debugger) ; only while edebug is active. | 2169 | |
| 2229 | (edebug-outside-debug-on-error debug-on-error) | 2170 | (debugger edebug-debugger) ; only while edebug is active. |
| 2230 | (edebug-outside-debug-on-quit debug-on-quit) | 2171 | (edebug-outside-debug-on-error debug-on-error) |
| 2231 | ;; Binding these may not be the right thing to do. | 2172 | (edebug-outside-debug-on-quit debug-on-quit) |
| 2232 | ;; We want to allow the global values to be changed. | 2173 | ;; Binding these may not be the right thing to do. |
| 2233 | (debug-on-error (or debug-on-error edebug-on-error)) | 2174 | ;; We want to allow the global values to be changed. |
| 2234 | (debug-on-quit edebug-on-quit) | 2175 | (debug-on-error (or debug-on-error edebug-on-error)) |
| 2235 | 2176 | (debug-on-quit edebug-on-quit) | |
| 2236 | ;; Lexical bindings must be uncompiled for this to work. | 2177 | |
| 2237 | (cl-lexical-debug t)) | 2178 | ;; Lexical bindings must be uncompiled for this to work. |
| 2238 | (unwind-protect | 2179 | (cl-lexical-debug t)) |
| 2239 | (let ((signal-hook-function 'edebug-signal)) | 2180 | (unwind-protect |
| 2240 | (setq edebug-execution-mode (or edebug-next-execution-mode | 2181 | (let ((signal-hook-function 'edebug-signal)) |
| 2241 | edebug-initial-mode | 2182 | (setq edebug-execution-mode (or edebug-next-execution-mode |
| 2242 | edebug-execution-mode) | 2183 | edebug-initial-mode |
| 2243 | edebug-next-execution-mode nil) | 2184 | edebug-execution-mode) |
| 2244 | (edebug-enter edebug-function edebug-args edebug-body)))) | 2185 | edebug-next-execution-mode nil) |
| 2245 | 2186 | (edebug-enter function args body)))) | |
| 2246 | (let* ((edebug-data (get edebug-function 'edebug)) | 2187 | |
| 2247 | (edebug-def-mark (car edebug-data)) ; mark at def start | 2188 | (let* ((edebug-data (get function 'edebug)) |
| 2248 | (edebug-freq-count (get edebug-function 'edebug-freq-count)) | 2189 | (edebug-def-mark (car edebug-data)) ; mark at def start |
| 2249 | (edebug-coverage (get edebug-function 'edebug-coverage)) | 2190 | (edebug-freq-count (get function 'edebug-freq-count)) |
| 2250 | (edebug-buffer (marker-buffer edebug-def-mark)) | 2191 | (edebug-coverage (get function 'edebug-coverage)) |
| 2251 | 2192 | (edebug-buffer (marker-buffer edebug-def-mark)) | |
| 2252 | (edebug-stack (cons edebug-function edebug-stack)) | 2193 | |
| 2253 | (edebug-offset-indices (cons 0 edebug-offset-indices)) | 2194 | (edebug-stack (cons function edebug-stack)) |
| 2254 | ) | 2195 | (edebug-offset-indices (cons 0 edebug-offset-indices)) |
| 2255 | (if (get edebug-function 'edebug-on-entry) | 2196 | ) |
| 2256 | (progn | 2197 | (if (get function 'edebug-on-entry) |
| 2257 | (setq edebug-execution-mode 'step) | 2198 | (progn |
| 2258 | (if (eq (get edebug-function 'edebug-on-entry) 'temp) | 2199 | (setq edebug-execution-mode 'step) |
| 2259 | (put edebug-function 'edebug-on-entry nil)))) | 2200 | (if (eq (get function 'edebug-on-entry) 'temp) |
| 2260 | (if edebug-trace | 2201 | (put function 'edebug-on-entry nil)))) |
| 2261 | (edebug-enter-trace edebug-body) | 2202 | (if edebug-trace |
| 2262 | (funcall edebug-body)) | 2203 | (edebug--enter-trace function args body) |
| 2263 | ))) | 2204 | (funcall body)) |
| 2205 | )))) | ||
| 2264 | 2206 | ||
| 2265 | (defun edebug-var-status (var) | 2207 | (defun edebug-var-status (var) |
| 2266 | "Return a cons cell describing the status of VAR's current binding. | 2208 | "Return a cons cell describing the status of VAR's current binding. |
| @@ -2287,14 +2229,14 @@ STATUS should be a list returned by `edebug-var-status'." | |||
| 2287 | (t | 2229 | (t |
| 2288 | (set var value))))) | 2230 | (set var value))))) |
| 2289 | 2231 | ||
| 2290 | (defun edebug-enter-trace (edebug-body) | 2232 | (defun edebug--enter-trace (function args body) |
| 2291 | (let ((edebug-stack-depth (1+ edebug-stack-depth)) | 2233 | (let ((edebug-stack-depth (1+ edebug-stack-depth)) |
| 2292 | edebug-result) | 2234 | edebug-result) |
| 2293 | (edebug-print-trace-before | 2235 | (edebug-print-trace-before |
| 2294 | (format "%s args: %s" edebug-function edebug-args)) | 2236 | (format "%s args: %s" function args)) |
| 2295 | (prog1 (setq edebug-result (funcall edebug-body)) | 2237 | (prog1 (setq edebug-result (funcall body)) |
| 2296 | (edebug-print-trace-after | 2238 | (edebug-print-trace-after |
| 2297 | (format "%s result: %s" edebug-function edebug-result))))) | 2239 | (format "%s result: %s" function edebug-result))))) |
| 2298 | 2240 | ||
| 2299 | (def-edebug-spec edebug-tracing (form body)) | 2241 | (def-edebug-spec edebug-tracing (form body)) |
| 2300 | 2242 | ||
| @@ -2322,49 +2264,49 @@ MSG is printed after `::::} '." | |||
| 2322 | 2264 | ||
| 2323 | 2265 | ||
| 2324 | 2266 | ||
| 2325 | (defun edebug-slow-before (edebug-before-index) | 2267 | (defun edebug-slow-before (before-index) |
| 2326 | (unless edebug-active | 2268 | (unless edebug-active |
| 2327 | ;; Debug current function given BEFORE position. | 2269 | ;; Debug current function given BEFORE position. |
| 2328 | ;; Called from functions compiled with edebug-eval-top-level-form. | 2270 | ;; Called from functions compiled with edebug-eval-top-level-form. |
| 2329 | ;; Return the before index. | 2271 | ;; Return the before index. |
| 2330 | (setcar edebug-offset-indices edebug-before-index) | 2272 | (setcar edebug-offset-indices before-index) |
| 2331 | 2273 | ||
| 2332 | ;; Increment frequency count | 2274 | ;; Increment frequency count |
| 2333 | (aset edebug-freq-count edebug-before-index | 2275 | (aset edebug-freq-count before-index |
| 2334 | (1+ (aref edebug-freq-count edebug-before-index))) | 2276 | (1+ (aref edebug-freq-count before-index))) |
| 2335 | 2277 | ||
| 2336 | (if (or (not (memq edebug-execution-mode '(Go-nonstop next))) | 2278 | (if (or (not (memq edebug-execution-mode '(Go-nonstop next))) |
| 2337 | (edebug-input-pending-p)) | 2279 | (input-pending-p)) |
| 2338 | (edebug-debugger edebug-before-index 'before nil))) | 2280 | (edebug-debugger before-index 'before nil))) |
| 2339 | edebug-before-index) | 2281 | before-index) |
| 2340 | 2282 | ||
| 2341 | (defun edebug-fast-before (edebug-before-index) | 2283 | (defun edebug-fast-before (_before-index) |
| 2342 | ;; Do nothing. | 2284 | ;; Do nothing. |
| 2343 | ) | 2285 | ) |
| 2344 | 2286 | ||
| 2345 | (defun edebug-slow-after (edebug-before-index edebug-after-index edebug-value) | 2287 | (defun edebug-slow-after (_before-index after-index value) |
| 2346 | (if edebug-active | 2288 | (if edebug-active |
| 2347 | edebug-value | 2289 | value |
| 2348 | ;; Debug current function given AFTER position and VALUE. | 2290 | ;; Debug current function given AFTER position and VALUE. |
| 2349 | ;; Called from functions compiled with edebug-eval-top-level-form. | 2291 | ;; Called from functions compiled with edebug-eval-top-level-form. |
| 2350 | ;; Return VALUE. | 2292 | ;; Return VALUE. |
| 2351 | (setcar edebug-offset-indices edebug-after-index) | 2293 | (setcar edebug-offset-indices after-index) |
| 2352 | 2294 | ||
| 2353 | ;; Increment frequency count | 2295 | ;; Increment frequency count |
| 2354 | (aset edebug-freq-count edebug-after-index | 2296 | (aset edebug-freq-count after-index |
| 2355 | (1+ (aref edebug-freq-count edebug-after-index))) | 2297 | (1+ (aref edebug-freq-count after-index))) |
| 2356 | (if edebug-test-coverage (edebug-update-coverage)) | 2298 | (if edebug-test-coverage (edebug--update-coverage after-index value)) |
| 2357 | 2299 | ||
| 2358 | (if (and (eq edebug-execution-mode 'Go-nonstop) | 2300 | (if (and (eq edebug-execution-mode 'Go-nonstop) |
| 2359 | (not (edebug-input-pending-p))) | 2301 | (not (input-pending-p))) |
| 2360 | ;; Just return result. | 2302 | ;; Just return result. |
| 2361 | edebug-value | 2303 | value |
| 2362 | (edebug-debugger edebug-after-index 'after edebug-value) | 2304 | (edebug-debugger after-index 'after value) |
| 2363 | ))) | 2305 | ))) |
| 2364 | 2306 | ||
| 2365 | (defun edebug-fast-after (edebug-before-index edebug-after-index edebug-value) | 2307 | (defun edebug-fast-after (_before-index _after-index value) |
| 2366 | ;; Do nothing but return the value. | 2308 | ;; Do nothing but return the value. |
| 2367 | edebug-value) | 2309 | value) |
| 2368 | 2310 | ||
| 2369 | (defun edebug-run-slow () | 2311 | (defun edebug-run-slow () |
| 2370 | (defalias 'edebug-before 'edebug-slow-before) | 2312 | (defalias 'edebug-before 'edebug-slow-before) |
| @@ -2378,19 +2320,18 @@ MSG is printed after `::::} '." | |||
| 2378 | (edebug-run-slow) | 2320 | (edebug-run-slow) |
| 2379 | 2321 | ||
| 2380 | 2322 | ||
| 2381 | (defun edebug-update-coverage () | 2323 | (defun edebug--update-coverage (after-index value) |
| 2382 | (let ((old-result (aref edebug-coverage edebug-after-index))) | 2324 | (let ((old-result (aref edebug-coverage after-index))) |
| 2383 | (cond | 2325 | (cond |
| 2384 | ((eq 'ok-coverage old-result)) | 2326 | ((eq 'ok-coverage old-result)) |
| 2385 | ((eq 'unknown old-result) | 2327 | ((eq 'unknown old-result) |
| 2386 | (aset edebug-coverage edebug-after-index edebug-value)) | 2328 | (aset edebug-coverage after-index value)) |
| 2387 | ;; Test if a different result. | 2329 | ;; Test if a different result. |
| 2388 | ((not (eq edebug-value old-result)) | 2330 | ((not (eq value old-result)) |
| 2389 | (aset edebug-coverage edebug-after-index 'ok-coverage))))) | 2331 | (aset edebug-coverage after-index 'ok-coverage))))) |
| 2390 | 2332 | ||
| 2391 | 2333 | ||
| 2392 | ;; Dynamically declared unbound variables. | 2334 | ;; Dynamically declared unbound variables. |
| 2393 | (defvar edebug-arg-mode) ; the mode, either before, after, or error | ||
| 2394 | (defvar edebug-breakpoints) | 2335 | (defvar edebug-breakpoints) |
| 2395 | (defvar edebug-break-data) ; break data for current function. | 2336 | (defvar edebug-break-data) ; break data for current function. |
| 2396 | (defvar edebug-break) ; whether a break occurred. | 2337 | (defvar edebug-break) ; whether a break occurred. |
| @@ -2401,16 +2342,16 @@ MSG is printed after `::::} '." | |||
| 2401 | (defvar edebug-global-break-result nil) | 2342 | (defvar edebug-global-break-result nil) |
| 2402 | 2343 | ||
| 2403 | 2344 | ||
| 2404 | (defun edebug-debugger (edebug-offset-index edebug-arg-mode edebug-value) | 2345 | (defun edebug-debugger (offset-index arg-mode value) |
| 2405 | (if inhibit-redisplay | 2346 | (if inhibit-redisplay |
| 2406 | ;; Don't really try to enter edebug within an eval from redisplay. | 2347 | ;; Don't really try to enter edebug within an eval from redisplay. |
| 2407 | edebug-value | 2348 | value |
| 2408 | ;; Check breakpoints and pending input. | 2349 | ;; Check breakpoints and pending input. |
| 2409 | ;; If edebug display should be updated, call edebug-display. | 2350 | ;; If edebug display should be updated, call edebug--display. |
| 2410 | ;; Return edebug-value. | 2351 | ;; Return value. |
| 2411 | (let* ( ;; This needs to be here since breakpoints may be changed. | 2352 | (let* ( ;; This needs to be here since breakpoints may be changed. |
| 2412 | (edebug-breakpoints (car (cdr edebug-data))) ; list of breakpoints | 2353 | (edebug-breakpoints (car (cdr edebug-data))) ; list of breakpoints |
| 2413 | (edebug-break-data (assq edebug-offset-index edebug-breakpoints)) | 2354 | (edebug-break-data (assq offset-index edebug-breakpoints)) |
| 2414 | (edebug-break-condition (car (cdr edebug-break-data))) | 2355 | (edebug-break-condition (car (cdr edebug-break-data))) |
| 2415 | (edebug-global-break | 2356 | (edebug-global-break |
| 2416 | (if edebug-global-break-condition | 2357 | (if edebug-global-break-condition |
| @@ -2421,7 +2362,7 @@ MSG is printed after `::::} '." | |||
| 2421 | (error nil)))) | 2362 | (error nil)))) |
| 2422 | (edebug-break)) | 2363 | (edebug-break)) |
| 2423 | 2364 | ||
| 2424 | ;;; (edebug-trace "exp: %s" edebug-value) | 2365 | ;;(edebug-trace "exp: %s" value) |
| 2425 | ;; Test whether we should break. | 2366 | ;; Test whether we should break. |
| 2426 | (setq edebug-break | 2367 | (setq edebug-break |
| 2427 | (or edebug-global-break | 2368 | (or edebug-global-break |
| @@ -2441,11 +2382,10 @@ MSG is printed after `::::} '." | |||
| 2441 | ;; or break, or input is pending, | 2382 | ;; or break, or input is pending, |
| 2442 | (if (or (not (memq edebug-execution-mode '(go continue Continue-fast))) | 2383 | (if (or (not (memq edebug-execution-mode '(go continue Continue-fast))) |
| 2443 | edebug-break | 2384 | edebug-break |
| 2444 | (edebug-input-pending-p)) | 2385 | (input-pending-p)) |
| 2445 | (edebug-display)) ; <--------------- display | 2386 | (edebug--display value offset-index arg-mode)) ; <---------- display |
| 2446 | 2387 | ||
| 2447 | edebug-value | 2388 | value))) |
| 2448 | ))) | ||
| 2449 | 2389 | ||
| 2450 | 2390 | ||
| 2451 | ;; window-start now stored with each function. | 2391 | ;; window-start now stored with each function. |
| @@ -2477,8 +2417,9 @@ MSG is printed after `::::} '." | |||
| 2477 | ;; Emacs 19 adds an arg to mark and mark-marker. | 2417 | ;; Emacs 19 adds an arg to mark and mark-marker. |
| 2478 | (defalias 'edebug-mark-marker 'mark-marker) | 2418 | (defalias 'edebug-mark-marker 'mark-marker) |
| 2479 | 2419 | ||
| 2420 | (defvar edebug-outside-unread-command-events) | ||
| 2480 | 2421 | ||
| 2481 | (defun edebug-display () | 2422 | (defun edebug--display (value offset-index arg-mode) |
| 2482 | (unless (marker-position edebug-def-mark) | 2423 | (unless (marker-position edebug-def-mark) |
| 2483 | ;; The buffer holding the source has been killed. | 2424 | ;; The buffer holding the source has been killed. |
| 2484 | ;; Let's at least show a backtrace so the user can figure out | 2425 | ;; Let's at least show a backtrace so the user can figure out |
| @@ -2487,11 +2428,11 @@ MSG is printed after `::::} '." | |||
| 2487 | ;; Setup windows for edebug, determine mode, maybe enter recursive-edit. | 2428 | ;; Setup windows for edebug, determine mode, maybe enter recursive-edit. |
| 2488 | ;; Uses local variables of edebug-enter, edebug-before, edebug-after | 2429 | ;; Uses local variables of edebug-enter, edebug-before, edebug-after |
| 2489 | ;; and edebug-debugger. | 2430 | ;; and edebug-debugger. |
| 2490 | (let ((edebug-active t) ; for minor mode alist | 2431 | (let ((edebug-active t) ; For minor mode alist. |
| 2491 | (edebug-with-timeout-suspend (with-timeout-suspend)) | 2432 | (edebug-with-timeout-suspend (with-timeout-suspend)) |
| 2492 | edebug-stop ; should we enter recursive-edit | 2433 | edebug-stop ; Should we enter recursive-edit? |
| 2493 | (edebug-point (+ edebug-def-mark | 2434 | (edebug-point (+ edebug-def-mark |
| 2494 | (aref (nth 2 edebug-data) edebug-offset-index))) | 2435 | (aref (nth 2 edebug-data) offset-index))) |
| 2495 | edebug-buffer-outside-point ; current point in edebug-buffer | 2436 | edebug-buffer-outside-point ; current point in edebug-buffer |
| 2496 | ;; window displaying edebug-buffer | 2437 | ;; window displaying edebug-buffer |
| 2497 | (edebug-window-data (nth 3 edebug-data)) | 2438 | (edebug-window-data (nth 3 edebug-data)) |
| @@ -2500,12 +2441,12 @@ MSG is printed after `::::} '." | |||
| 2500 | (edebug-outside-point (point)) | 2441 | (edebug-outside-point (point)) |
| 2501 | (edebug-outside-mark (edebug-mark)) | 2442 | (edebug-outside-mark (edebug-mark)) |
| 2502 | (edebug-outside-unread-command-events unread-command-events) | 2443 | (edebug-outside-unread-command-events unread-command-events) |
| 2503 | edebug-outside-windows ; window or screen configuration | 2444 | edebug-outside-windows ; Window or screen configuration. |
| 2504 | edebug-buffer-points | 2445 | edebug-buffer-points |
| 2505 | 2446 | ||
| 2506 | edebug-eval-buffer ; declared here so we can kill it below | 2447 | edebug-eval-buffer ; Declared here so we can kill it below. |
| 2507 | (edebug-eval-result-list (and edebug-eval-list | 2448 | (eval-result-list (and edebug-eval-list |
| 2508 | (edebug-eval-result-list))) | 2449 | (edebug-eval-result-list))) |
| 2509 | edebug-trace-window | 2450 | edebug-trace-window |
| 2510 | edebug-trace-window-start | 2451 | edebug-trace-window-start |
| 2511 | 2452 | ||
| @@ -2518,7 +2459,7 @@ MSG is printed after `::::} '." | |||
| 2518 | (let ((overlay-arrow-position overlay-arrow-position) | 2459 | (let ((overlay-arrow-position overlay-arrow-position) |
| 2519 | (overlay-arrow-string overlay-arrow-string) | 2460 | (overlay-arrow-string overlay-arrow-string) |
| 2520 | (cursor-in-echo-area nil) | 2461 | (cursor-in-echo-area nil) |
| 2521 | (unread-command-events unread-command-events) | 2462 | (unread-command-events nil) |
| 2522 | ;; any others?? | 2463 | ;; any others?? |
| 2523 | ) | 2464 | ) |
| 2524 | (setq-default cursor-in-non-selected-windows t) | 2465 | (setq-default cursor-in-non-selected-windows t) |
| @@ -2526,9 +2467,9 @@ MSG is printed after `::::} '." | |||
| 2526 | (let ((debug-on-error nil)) | 2467 | (let ((debug-on-error nil)) |
| 2527 | (error "Buffer defining %s not found" edebug-function))) | 2468 | (error "Buffer defining %s not found" edebug-function))) |
| 2528 | 2469 | ||
| 2529 | (if (eq 'after edebug-arg-mode) | 2470 | (if (eq 'after arg-mode) |
| 2530 | ;; Compute result string now before windows are modified. | 2471 | ;; Compute result string now before windows are modified. |
| 2531 | (edebug-compute-previous-result edebug-value)) | 2472 | (edebug-compute-previous-result value)) |
| 2532 | 2473 | ||
| 2533 | (if edebug-save-windows | 2474 | (if edebug-save-windows |
| 2534 | ;; Save windows now before we modify them. | 2475 | ;; Save windows now before we modify them. |
| @@ -2552,7 +2493,7 @@ MSG is printed after `::::} '." | |||
| 2552 | ;; Now display eval list, if any. | 2493 | ;; Now display eval list, if any. |
| 2553 | ;; This is done after the pop to edebug-buffer | 2494 | ;; This is done after the pop to edebug-buffer |
| 2554 | ;; so that buffer-window correspondence is correct after quitting. | 2495 | ;; so that buffer-window correspondence is correct after quitting. |
| 2555 | (edebug-eval-display edebug-eval-result-list) | 2496 | (edebug-eval-display eval-result-list) |
| 2556 | ;; The evaluation list better not have deleted edebug-window-data. | 2497 | ;; The evaluation list better not have deleted edebug-window-data. |
| 2557 | (select-window (car edebug-window-data)) | 2498 | (select-window (car edebug-window-data)) |
| 2558 | (set-buffer edebug-buffer) | 2499 | (set-buffer edebug-buffer) |
| @@ -2560,7 +2501,7 @@ MSG is printed after `::::} '." | |||
| 2560 | (setq edebug-buffer-outside-point (point)) | 2501 | (setq edebug-buffer-outside-point (point)) |
| 2561 | (goto-char edebug-point) | 2502 | (goto-char edebug-point) |
| 2562 | 2503 | ||
| 2563 | (if (eq 'before edebug-arg-mode) | 2504 | (if (eq 'before arg-mode) |
| 2564 | ;; Check whether positions are up-to-date. | 2505 | ;; Check whether positions are up-to-date. |
| 2565 | ;; This assumes point is never before symbol. | 2506 | ;; This assumes point is never before symbol. |
| 2566 | (if (not (memq (following-char) '(?\( ?\# ?\` ))) | 2507 | (if (not (memq (following-char) '(?\( ?\# ?\` ))) |
| @@ -2573,7 +2514,7 @@ MSG is printed after `::::} '." | |||
| 2573 | (edebug-adjust-window (cdr edebug-window-data))) | 2514 | (edebug-adjust-window (cdr edebug-window-data))) |
| 2574 | 2515 | ||
| 2575 | ;; Test if there is input, not including keyboard macros. | 2516 | ;; Test if there is input, not including keyboard macros. |
| 2576 | (if (edebug-input-pending-p) | 2517 | (if (input-pending-p) |
| 2577 | (progn | 2518 | (progn |
| 2578 | (setq edebug-execution-mode 'step | 2519 | (setq edebug-execution-mode 'step |
| 2579 | edebug-stop t) | 2520 | edebug-stop t) |
| @@ -2584,14 +2525,14 @@ MSG is printed after `::::} '." | |||
| 2584 | (edebug-overlay-arrow) | 2525 | (edebug-overlay-arrow) |
| 2585 | 2526 | ||
| 2586 | (cond | 2527 | (cond |
| 2587 | ((eq 'error edebug-arg-mode) | 2528 | ((eq 'error arg-mode) |
| 2588 | ;; Display error message | 2529 | ;; Display error message |
| 2589 | (setq edebug-execution-mode 'step) | 2530 | (setq edebug-execution-mode 'step) |
| 2590 | (edebug-overlay-arrow) | 2531 | (edebug-overlay-arrow) |
| 2591 | (beep) | 2532 | (beep) |
| 2592 | (if (eq 'quit (car edebug-value)) | 2533 | (if (eq 'quit (car value)) |
| 2593 | (message "Quit") | 2534 | (message "Quit") |
| 2594 | (edebug-report-error edebug-value))) | 2535 | (edebug-report-error value))) |
| 2595 | (edebug-break | 2536 | (edebug-break |
| 2596 | (cond | 2537 | (cond |
| 2597 | (edebug-global-break | 2538 | (edebug-global-break |
| @@ -2608,41 +2549,40 @@ MSG is printed after `::::} '." | |||
| 2608 | 2549 | ||
| 2609 | (t (message ""))) | 2550 | (t (message ""))) |
| 2610 | 2551 | ||
| 2611 | (setq unread-command-events nil) | 2552 | (if (eq 'after arg-mode) |
| 2612 | (if (eq 'after edebug-arg-mode) | ||
| 2613 | (progn | 2553 | (progn |
| 2614 | ;; Display result of previous evaluation. | 2554 | ;; Display result of previous evaluation. |
| 2615 | (if (and edebug-break | 2555 | (if (and edebug-break |
| 2616 | (not (eq edebug-execution-mode 'Continue-fast))) | 2556 | (not (eq edebug-execution-mode 'Continue-fast))) |
| 2617 | (edebug-sit-for edebug-sit-for-seconds)) ; Show message. | 2557 | (sit-for edebug-sit-for-seconds)) ; Show message. |
| 2618 | (edebug-previous-result))) | 2558 | (edebug-previous-result))) |
| 2619 | 2559 | ||
| 2620 | (cond | 2560 | (cond |
| 2621 | (edebug-break | 2561 | (edebug-break |
| 2622 | (cond | 2562 | (cond |
| 2623 | ((eq edebug-execution-mode 'continue) | 2563 | ((eq edebug-execution-mode 'continue) |
| 2624 | (edebug-sit-for edebug-sit-for-seconds)) | 2564 | (sit-for edebug-sit-for-seconds)) |
| 2625 | ((eq edebug-execution-mode 'Continue-fast) (edebug-sit-for 0)) | 2565 | ((eq edebug-execution-mode 'Continue-fast) (sit-for 0)) |
| 2626 | (t (setq edebug-stop t)))) | 2566 | (t (setq edebug-stop t)))) |
| 2627 | ;; not edebug-break | 2567 | ;; not edebug-break |
| 2628 | ((eq edebug-execution-mode 'trace) | 2568 | ((eq edebug-execution-mode 'trace) |
| 2629 | (edebug-sit-for edebug-sit-for-seconds)) ; Force update and pause. | 2569 | (sit-for edebug-sit-for-seconds)) ; Force update and pause. |
| 2630 | ((eq edebug-execution-mode 'Trace-fast) | 2570 | ((eq edebug-execution-mode 'Trace-fast) |
| 2631 | (edebug-sit-for 0))) ; Force update and continue. | 2571 | (sit-for 0))) ; Force update and continue. |
| 2632 | 2572 | ||
| 2633 | (unwind-protect | 2573 | (unwind-protect |
| 2634 | (if (or edebug-stop | 2574 | (if (or edebug-stop |
| 2635 | (memq edebug-execution-mode '(step next)) | 2575 | (memq edebug-execution-mode '(step next)) |
| 2636 | (eq edebug-arg-mode 'error)) | 2576 | (eq arg-mode 'error)) |
| 2637 | (progn | 2577 | (progn |
| 2638 | ;; (setq edebug-execution-mode 'step) | 2578 | ;; (setq edebug-execution-mode 'step) |
| 2639 | ;; (edebug-overlay-arrow) ; This doesn't always show up. | 2579 | ;; (edebug-overlay-arrow) ; This doesn't always show up. |
| 2640 | (edebug-recursive-edit))) ; <---------- Recursive edit | 2580 | (edebug--recursive-edit arg-mode))) ; <----- Recursive edit |
| 2641 | 2581 | ||
| 2642 | ;; Reset the edebug-window-data to whatever it is now. | 2582 | ;; Reset the edebug-window-data to whatever it is now. |
| 2643 | (let ((window (if (eq (window-buffer) edebug-buffer) | 2583 | (let ((window (if (eq (window-buffer) edebug-buffer) |
| 2644 | (selected-window) | 2584 | (selected-window) |
| 2645 | (edebug-get-buffer-window edebug-buffer)))) | 2585 | (get-buffer-window edebug-buffer)))) |
| 2646 | ;; Remember window-start for edebug-buffer, if still displayed. | 2586 | ;; Remember window-start for edebug-buffer, if still displayed. |
| 2647 | (if window | 2587 | (if window |
| 2648 | (progn | 2588 | (progn |
| @@ -2720,6 +2660,8 @@ MSG is printed after `::::} '." | |||
| 2720 | (goto-char edebug-buffer-outside-point)) | 2660 | (goto-char edebug-buffer-outside-point)) |
| 2721 | ;; ... nothing more. | 2661 | ;; ... nothing more. |
| 2722 | ) | 2662 | ) |
| 2663 | ;; Could be an option to keep eval display up. | ||
| 2664 | (if edebug-eval-buffer (kill-buffer edebug-eval-buffer)) | ||
| 2723 | (with-timeout-unsuspend edebug-with-timeout-suspend) | 2665 | (with-timeout-unsuspend edebug-with-timeout-suspend) |
| 2724 | ;; Reset global variables to outside values in case they were changed. | 2666 | ;; Reset global variables to outside values in case they were changed. |
| 2725 | (setq | 2667 | (setq |
| @@ -2760,13 +2702,12 @@ MSG is printed after `::::} '." | |||
| 2760 | 2702 | ||
| 2761 | ;; Emacs 19. | 2703 | ;; Emacs 19. |
| 2762 | (defvar edebug-outside-last-command-event) | 2704 | (defvar edebug-outside-last-command-event) |
| 2763 | (defvar edebug-outside-unread-command-events) | ||
| 2764 | (defvar edebug-outside-last-input-event) | 2705 | (defvar edebug-outside-last-input-event) |
| 2765 | (defvar edebug-outside-last-event-frame) | 2706 | (defvar edebug-outside-last-event-frame) |
| 2766 | (defvar edebug-outside-last-nonmenu-event) | 2707 | (defvar edebug-outside-last-nonmenu-event) |
| 2767 | (defvar edebug-outside-track-mouse) | 2708 | (defvar edebug-outside-track-mouse) |
| 2768 | 2709 | ||
| 2769 | (defun edebug-recursive-edit () | 2710 | (defun edebug--recursive-edit (arg-mode) |
| 2770 | ;; Start up a recursive edit inside of edebug. | 2711 | ;; Start up a recursive edit inside of edebug. |
| 2771 | ;; The current buffer is the edebug-buffer, which is put into edebug-mode. | 2712 | ;; The current buffer is the edebug-buffer, which is put into edebug-mode. |
| 2772 | ;; Assume that none of the variables below are buffer-local. | 2713 | ;; Assume that none of the variables below are buffer-local. |
| @@ -2822,6 +2763,9 @@ MSG is printed after `::::} '." | |||
| 2822 | (last-nonmenu-event nil) | 2763 | (last-nonmenu-event nil) |
| 2823 | (track-mouse nil) | 2764 | (track-mouse nil) |
| 2824 | 2765 | ||
| 2766 | (standard-output t) | ||
| 2767 | (standard-input t) | ||
| 2768 | |||
| 2825 | ;; Don't keep reading from an executing kbd macro | 2769 | ;; Don't keep reading from an executing kbd macro |
| 2826 | ;; within edebug unless edebug-continue-kbd-macro is | 2770 | ;; within edebug unless edebug-continue-kbd-macro is |
| 2827 | ;; non-nil. Again, local binding may not be best. | 2771 | ;; non-nil. Again, local binding may not be best. |
| @@ -2850,7 +2794,7 @@ MSG is printed after `::::} '." | |||
| 2850 | ) | 2794 | ) |
| 2851 | 2795 | ||
| 2852 | (if (and (eq edebug-execution-mode 'go) | 2796 | (if (and (eq edebug-execution-mode 'go) |
| 2853 | (not (memq edebug-arg-mode '(after error)))) | 2797 | (not (memq arg-mode '(after error)))) |
| 2854 | (message "Break")) | 2798 | (message "Break")) |
| 2855 | 2799 | ||
| 2856 | (setq signal-hook-function nil) | 2800 | (setq signal-hook-function nil) |
| @@ -2863,8 +2807,6 @@ MSG is printed after `::::} '." | |||
| 2863 | (setq signal-hook-function 'edebug-signal) | 2807 | (setq signal-hook-function 'edebug-signal) |
| 2864 | (if edebug-backtrace-buffer | 2808 | (if edebug-backtrace-buffer |
| 2865 | (kill-buffer edebug-backtrace-buffer)) | 2809 | (kill-buffer edebug-backtrace-buffer)) |
| 2866 | ;; Could be an option to keep eval display up. | ||
| 2867 | (if edebug-eval-buffer (kill-buffer edebug-eval-buffer)) | ||
| 2868 | 2810 | ||
| 2869 | ;; Remember selected-window after recursive-edit. | 2811 | ;; Remember selected-window after recursive-edit. |
| 2870 | ;; (setq edebug-inside-window (selected-window)) | 2812 | ;; (setq edebug-inside-window (selected-window)) |
| @@ -2909,8 +2851,8 @@ MSG is printed after `::::} '." | |||
| 2909 | 2851 | ||
| 2910 | (defun edebug-adjust-window (old-start) | 2852 | (defun edebug-adjust-window (old-start) |
| 2911 | ;; If pos is not visible, adjust current window to fit following context. | 2853 | ;; If pos is not visible, adjust current window to fit following context. |
| 2912 | ;;; (message "window: %s old-start: %s window-start: %s pos: %s" | 2854 | ;; (message "window: %s old-start: %s window-start: %s pos: %s" |
| 2913 | ;;; (selected-window) old-start (window-start) (point)) (sit-for 5) | 2855 | ;; (selected-window) old-start (window-start) (point)) (sit-for 5) |
| 2914 | (if (not (pos-visible-in-window-p)) | 2856 | (if (not (pos-visible-in-window-p)) |
| 2915 | (progn | 2857 | (progn |
| 2916 | ;; First try old-start | 2858 | ;; First try old-start |
| @@ -2918,7 +2860,7 @@ MSG is printed after `::::} '." | |||
| 2918 | (set-window-start (selected-window) old-start)) | 2860 | (set-window-start (selected-window) old-start)) |
| 2919 | (if (not (pos-visible-in-window-p)) | 2861 | (if (not (pos-visible-in-window-p)) |
| 2920 | (progn | 2862 | (progn |
| 2921 | ;; (message "resetting window start") (sit-for 2) | 2863 | ;; (message "resetting window start") (sit-for 2) |
| 2922 | (set-window-start | 2864 | (set-window-start |
| 2923 | (selected-window) | 2865 | (selected-window) |
| 2924 | (save-excursion | 2866 | (save-excursion |
| @@ -3057,12 +2999,12 @@ before returning. The default is one second." | |||
| 3057 | (current-buffer) (point) | 2999 | (current-buffer) (point) |
| 3058 | (if (marker-buffer (edebug-mark-marker)) | 3000 | (if (marker-buffer (edebug-mark-marker)) |
| 3059 | (marker-position (edebug-mark-marker)) "<not set>")) | 3001 | (marker-position (edebug-mark-marker)) "<not set>")) |
| 3060 | (edebug-sit-for arg) | 3002 | (sit-for arg) |
| 3061 | (edebug-pop-to-buffer edebug-buffer (car edebug-window-data))))) | 3003 | (edebug-pop-to-buffer edebug-buffer (car edebug-window-data))))) |
| 3062 | 3004 | ||
| 3063 | 3005 | ||
| 3064 | ;; Joe Wells, here is a start at your idea of adding a buffer to the internal | 3006 | ;; Joe Wells, here is a start at your idea of adding a buffer to the internal |
| 3065 | ;; display list. Still need to use this list in edebug-display. | 3007 | ;; display list. Still need to use this list in edebug--display. |
| 3066 | 3008 | ||
| 3067 | '(defvar edebug-display-buffer-list nil | 3009 | '(defvar edebug-display-buffer-list nil |
| 3068 | "List of buffers that edebug will display when it is active.") | 3010 | "List of buffers that edebug will display when it is active.") |
| @@ -3384,7 +3326,7 @@ function or macro is called, Edebug will be called there as well." | |||
| 3384 | (save-excursion | 3326 | (save-excursion |
| 3385 | (down-list 1) | 3327 | (down-list 1) |
| 3386 | (if (looking-at "\(") | 3328 | (if (looking-at "\(") |
| 3387 | (edebug-form-data-name | 3329 | (edebug--form-data-name |
| 3388 | (edebug-get-form-data-entry (point))) | 3330 | (edebug-get-form-data-entry (point))) |
| 3389 | (edebug-original-read (current-buffer)))))) | 3331 | (edebug-original-read (current-buffer)))))) |
| 3390 | (edebug-instrument-function func)))) | 3332 | (edebug-instrument-function func)))) |
| @@ -3497,11 +3439,10 @@ edebug-mode." | |||
| 3497 | 3439 | ||
| 3498 | ;;; Evaluation of expressions | 3440 | ;;; Evaluation of expressions |
| 3499 | 3441 | ||
| 3500 | (def-edebug-spec edebug-outside-excursion t) | ||
| 3501 | |||
| 3502 | (defmacro edebug-outside-excursion (&rest body) | 3442 | (defmacro edebug-outside-excursion (&rest body) |
| 3503 | "Evaluate an expression list in the outside context. | 3443 | "Evaluate an expression list in the outside context. |
| 3504 | Return the result of the last expression." | 3444 | Return the result of the last expression." |
| 3445 | (declare (debug t)) | ||
| 3505 | `(save-excursion ; of current-buffer | 3446 | `(save-excursion ; of current-buffer |
| 3506 | (if edebug-save-windows | 3447 | (if edebug-save-windows |
| 3507 | (progn | 3448 | (progn |
| @@ -3535,7 +3476,7 @@ Return the result of the last expression." | |||
| 3535 | (pre-command-hook (cdr edebug-outside-pre-command-hook)) | 3476 | (pre-command-hook (cdr edebug-outside-pre-command-hook)) |
| 3536 | (post-command-hook (cdr edebug-outside-post-command-hook)) | 3477 | (post-command-hook (cdr edebug-outside-post-command-hook)) |
| 3537 | 3478 | ||
| 3538 | ;; See edebug-display | 3479 | ;; See edebug-display. |
| 3539 | (overlay-arrow-position edebug-outside-o-a-p) | 3480 | (overlay-arrow-position edebug-outside-o-a-p) |
| 3540 | (overlay-arrow-string edebug-outside-o-a-s) | 3481 | (overlay-arrow-string edebug-outside-o-a-s) |
| 3541 | (cursor-in-echo-area edebug-outside-c-i-e-a) | 3482 | (cursor-in-echo-area edebug-outside-c-i-e-a) |
| @@ -3589,18 +3530,19 @@ Return the result of the last expression." | |||
| 3589 | 3530 | ||
| 3590 | (defvar cl-debug-env) ; defined in cl; non-nil when lexical env used. | 3531 | (defvar cl-debug-env) ; defined in cl; non-nil when lexical env used. |
| 3591 | 3532 | ||
| 3592 | (defun edebug-eval (edebug-expr) | 3533 | (defun edebug-eval (expr) |
| 3593 | ;; Are there cl lexical variables active? | 3534 | ;; Are there cl lexical variables active? |
| 3594 | (eval (if (bound-and-true-p cl-debug-env) | 3535 | (eval (if (and (bound-and-true-p cl-debug-env) |
| 3595 | (cl-macroexpand-all edebug-expr cl-debug-env) | 3536 | (fboundp 'cl-macroexpand-all)) |
| 3596 | edebug-expr) | 3537 | (cl-macroexpand-all expr cl-debug-env) |
| 3538 | expr) | ||
| 3597 | lexical-binding)) | 3539 | lexical-binding)) |
| 3598 | 3540 | ||
| 3599 | (defun edebug-safe-eval (edebug-expr) | 3541 | (defun edebug-safe-eval (expr) |
| 3600 | ;; Evaluate EXPR safely. | 3542 | ;; Evaluate EXPR safely. |
| 3601 | ;; If there is an error, a string is returned describing the error. | 3543 | ;; If there is an error, a string is returned describing the error. |
| 3602 | (condition-case edebug-err | 3544 | (condition-case edebug-err |
| 3603 | (edebug-eval edebug-expr) | 3545 | (edebug-eval expr) |
| 3604 | (error (edebug-format "%s: %s" ;; could | 3546 | (error (edebug-format "%s: %s" ;; could |
| 3605 | (get (car edebug-err) 'error-message) | 3547 | (get (car edebug-err) 'error-message) |
| 3606 | (car (cdr edebug-err)))))) | 3548 | (car (cdr edebug-err)))))) |
| @@ -3608,17 +3550,17 @@ Return the result of the last expression." | |||
| 3608 | ;;; Printing | 3550 | ;;; Printing |
| 3609 | 3551 | ||
| 3610 | 3552 | ||
| 3611 | (defun edebug-report-error (edebug-value) | 3553 | (defun edebug-report-error (value) |
| 3612 | ;; Print an error message like command level does. | 3554 | ;; Print an error message like command level does. |
| 3613 | ;; This also prints the error name if it has no error-message. | 3555 | ;; This also prints the error name if it has no error-message. |
| 3614 | (message "%s: %s" | 3556 | (message "%s: %s" |
| 3615 | (or (get (car edebug-value) 'error-message) | 3557 | (or (get (car value) 'error-message) |
| 3616 | (format "peculiar error (%s)" (car edebug-value))) | 3558 | (format "peculiar error (%s)" (car value))) |
| 3617 | (mapconcat (function (lambda (edebug-arg) | 3559 | (mapconcat (function (lambda (edebug-arg) |
| 3618 | ;; continuing after an error may | 3560 | ;; continuing after an error may |
| 3619 | ;; complain about edebug-arg. why?? | 3561 | ;; complain about edebug-arg. why?? |
| 3620 | (prin1-to-string edebug-arg))) | 3562 | (prin1-to-string edebug-arg))) |
| 3621 | (cdr edebug-value) ", "))) | 3563 | (cdr value) ", "))) |
| 3622 | 3564 | ||
| 3623 | (defvar print-readably) ; defined by lemacs | 3565 | (defvar print-readably) ; defined by lemacs |
| 3624 | ;; Alternatively, we could change the definition of | 3566 | ;; Alternatively, we could change the definition of |
| @@ -3634,14 +3576,14 @@ Return the result of the last expression." | |||
| 3634 | (edebug-prin1-to-string value) | 3576 | (edebug-prin1-to-string value) |
| 3635 | (error "#Apparently circular structure#")))) | 3577 | (error "#Apparently circular structure#")))) |
| 3636 | 3578 | ||
| 3637 | (defun edebug-compute-previous-result (edebug-previous-value) | 3579 | (defun edebug-compute-previous-result (previous-value) |
| 3638 | (if edebug-unwrap-results | 3580 | (if edebug-unwrap-results |
| 3639 | (setq edebug-previous-value | 3581 | (setq previous-value |
| 3640 | (edebug-unwrap* edebug-previous-value))) | 3582 | (edebug-unwrap* previous-value))) |
| 3641 | (setq edebug-previous-result | 3583 | (setq edebug-previous-result |
| 3642 | (concat "Result: " | 3584 | (concat "Result: " |
| 3643 | (edebug-safe-prin1-to-string edebug-previous-value) | 3585 | (edebug-safe-prin1-to-string previous-value) |
| 3644 | (eval-expression-print-format edebug-previous-value)))) | 3586 | (eval-expression-print-format previous-value)))) |
| 3645 | 3587 | ||
| 3646 | (defun edebug-previous-result () | 3588 | (defun edebug-previous-result () |
| 3647 | "Print the previous result." | 3589 | "Print the previous result." |
| @@ -3656,7 +3598,7 @@ Return the result of the last expression." | |||
| 3656 | (defalias 'edebug-format 'format) | 3598 | (defalias 'edebug-format 'format) |
| 3657 | (defalias 'edebug-message 'message) | 3599 | (defalias 'edebug-message 'message) |
| 3658 | 3600 | ||
| 3659 | (defun edebug-eval-expression (edebug-expr) | 3601 | (defun edebug-eval-expression (expr) |
| 3660 | "Evaluate an expression in the outside environment. | 3602 | "Evaluate an expression in the outside environment. |
| 3661 | If interactive, prompt for the expression. | 3603 | If interactive, prompt for the expression. |
| 3662 | Print result in minibuffer." | 3604 | Print result in minibuffer." |
| @@ -3665,7 +3607,7 @@ Print result in minibuffer." | |||
| 3665 | 'read-expression-history))) | 3607 | 'read-expression-history))) |
| 3666 | (princ | 3608 | (princ |
| 3667 | (edebug-outside-excursion | 3609 | (edebug-outside-excursion |
| 3668 | (setq values (cons (edebug-eval edebug-expr) values)) | 3610 | (setq values (cons (edebug-eval expr) values)) |
| 3669 | (concat (edebug-safe-prin1-to-string (car values)) | 3611 | (concat (edebug-safe-prin1-to-string (car values)) |
| 3670 | (eval-expression-print-format (car values)))))) | 3612 | (eval-expression-print-format (car values)))))) |
| 3671 | 3613 | ||
| @@ -3679,14 +3621,14 @@ Print value in minibuffer." | |||
| 3679 | "Evaluate sexp before point in outside environment; insert value. | 3621 | "Evaluate sexp before point in outside environment; insert value. |
| 3680 | This prints the value into current buffer." | 3622 | This prints the value into current buffer." |
| 3681 | (interactive) | 3623 | (interactive) |
| 3682 | (let* ((edebug-form (edebug-last-sexp)) | 3624 | (let* ((form (edebug-last-sexp)) |
| 3683 | (edebug-result-string | 3625 | (result-string |
| 3684 | (edebug-outside-excursion | 3626 | (edebug-outside-excursion |
| 3685 | (edebug-safe-prin1-to-string (edebug-safe-eval edebug-form)))) | 3627 | (edebug-safe-prin1-to-string (edebug-safe-eval form)))) |
| 3686 | (standard-output (current-buffer))) | 3628 | (standard-output (current-buffer))) |
| 3687 | (princ "\n") | 3629 | (princ "\n") |
| 3688 | ;; princ the string to get rid of quotes. | 3630 | ;; princ the string to get rid of quotes. |
| 3689 | (princ edebug-result-string) | 3631 | (princ result-string) |
| 3690 | (princ "\n") | 3632 | (princ "\n") |
| 3691 | )) | 3633 | )) |
| 3692 | 3634 | ||
| @@ -3895,44 +3837,38 @@ Options: | |||
| 3895 | (edebug-trace nil)) | 3837 | (edebug-trace nil)) |
| 3896 | (mapcar 'edebug-safe-eval edebug-eval-list))) | 3838 | (mapcar 'edebug-safe-eval edebug-eval-list))) |
| 3897 | 3839 | ||
| 3898 | (defun edebug-eval-display-list (edebug-eval-result-list) | 3840 | (defun edebug-eval-display-list (eval-result-list) |
| 3899 | ;; Assumes edebug-eval-buffer exists. | 3841 | ;; Assumes edebug-eval-buffer exists. |
| 3900 | (let ((edebug-eval-list-temp edebug-eval-list) | 3842 | (let ((standard-output edebug-eval-buffer) |
| 3901 | (standard-output edebug-eval-buffer) | ||
| 3902 | (edebug-comment-line | 3843 | (edebug-comment-line |
| 3903 | (format ";%s\n" (make-string (- (window-width) 2) ?-)))) | 3844 | (format ";%s\n" (make-string (- (window-width) 2) ?-)))) |
| 3904 | (set-buffer edebug-eval-buffer) | 3845 | (set-buffer edebug-eval-buffer) |
| 3905 | (erase-buffer) | 3846 | (erase-buffer) |
| 3906 | (while edebug-eval-list-temp | 3847 | (dolist (exp edebug-eval-list) |
| 3907 | (prin1 (car edebug-eval-list-temp)) (terpri) | 3848 | (prin1 exp) (terpri) |
| 3908 | (prin1 (car edebug-eval-result-list)) (terpri) | 3849 | (prin1 (pop eval-result-list)) (terpri) |
| 3909 | (princ edebug-comment-line) | 3850 | (princ edebug-comment-line)) |
| 3910 | (setq edebug-eval-list-temp (cdr edebug-eval-list-temp)) | ||
| 3911 | (setq edebug-eval-result-list (cdr edebug-eval-result-list))) | ||
| 3912 | (edebug-pop-to-buffer edebug-eval-buffer) | 3851 | (edebug-pop-to-buffer edebug-eval-buffer) |
| 3913 | )) | 3852 | )) |
| 3914 | 3853 | ||
| 3915 | (defun edebug-create-eval-buffer () | 3854 | (defun edebug-create-eval-buffer () |
| 3916 | (if (not (and edebug-eval-buffer (buffer-name edebug-eval-buffer))) | 3855 | (unless (and edebug-eval-buffer (buffer-name edebug-eval-buffer)) |
| 3917 | (progn | 3856 | (set-buffer (setq edebug-eval-buffer (get-buffer-create "*edebug*"))) |
| 3918 | (set-buffer (setq edebug-eval-buffer (get-buffer-create "*edebug*"))) | 3857 | (edebug-eval-mode))) |
| 3919 | (edebug-eval-mode)))) | ||
| 3920 | 3858 | ||
| 3921 | ;; Should generalize this to be callable outside of edebug | 3859 | ;; Should generalize this to be callable outside of edebug |
| 3922 | ;; with calls in user functions, e.g. (edebug-eval-display) | 3860 | ;; with calls in user functions, e.g. (edebug-eval-display) |
| 3923 | 3861 | ||
| 3924 | (defun edebug-eval-display (edebug-eval-result-list) | 3862 | (defun edebug-eval-display (eval-result-list) |
| 3925 | "Display expressions and evaluations in EDEBUG-EVAL-RESULT-LIST. | 3863 | "Display expressions and evaluations in EVAL-RESULT-LIST. |
| 3926 | It modifies the context by popping up the eval display." | 3864 | It modifies the context by popping up the eval display." |
| 3927 | (if edebug-eval-result-list | 3865 | (when eval-result-list |
| 3928 | (progn | 3866 | (edebug-create-eval-buffer) |
| 3929 | (edebug-create-eval-buffer) | 3867 | (edebug-eval-display-list eval-result-list))) |
| 3930 | (edebug-eval-display-list edebug-eval-result-list) | ||
| 3931 | ))) | ||
| 3932 | 3868 | ||
| 3933 | (defun edebug-eval-redisplay () | 3869 | (defun edebug-eval-redisplay () |
| 3934 | "Redisplay eval list in outside environment. | 3870 | "Redisplay eval list in outside environment. |
| 3935 | May only be called from within `edebug-recursive-edit'." | 3871 | May only be called from within `edebug--recursive-edit'." |
| 3936 | (edebug-create-eval-buffer) | 3872 | (edebug-create-eval-buffer) |
| 3937 | (edebug-outside-excursion | 3873 | (edebug-outside-excursion |
| 3938 | (edebug-eval-display-list (edebug-eval-result-list)) | 3874 | (edebug-eval-display-list (edebug-eval-result-list)) |
| @@ -3956,7 +3892,7 @@ May only be called from within `edebug-recursive-edit'." | |||
| 3956 | (if (not (eobp)) | 3892 | (if (not (eobp)) |
| 3957 | (progn | 3893 | (progn |
| 3958 | (forward-sexp 1) | 3894 | (forward-sexp 1) |
| 3959 | (setq new-list (cons (edebug-last-sexp) new-list)))) | 3895 | (push (edebug-last-sexp) new-list))) |
| 3960 | 3896 | ||
| 3961 | (while (re-search-forward "^;" nil t) | 3897 | (while (re-search-forward "^;" nil t) |
| 3962 | (forward-line 1) | 3898 | (forward-line 1) |
| @@ -3965,7 +3901,7 @@ May only be called from within `edebug-recursive-edit'." | |||
| 3965 | (not (eobp))) | 3901 | (not (eobp))) |
| 3966 | (progn | 3902 | (progn |
| 3967 | (forward-sexp 1) | 3903 | (forward-sexp 1) |
| 3968 | (setq new-list (cons (edebug-last-sexp) new-list))))) | 3904 | (push (edebug-last-sexp) new-list)))) |
| 3969 | 3905 | ||
| 3970 | (setq edebug-eval-list (nreverse new-list)) | 3906 | (setq edebug-eval-list (nreverse new-list)) |
| 3971 | (edebug-eval-redisplay) | 3907 | (edebug-eval-redisplay) |
| @@ -3994,8 +3930,8 @@ May only be called from within `edebug-recursive-edit'." | |||
| 3994 | (define-key map "\C-c\C-u" 'edebug-update-eval-list) | 3930 | (define-key map "\C-c\C-u" 'edebug-update-eval-list) |
| 3995 | (define-key map "\C-x\C-e" 'edebug-eval-last-sexp) | 3931 | (define-key map "\C-x\C-e" 'edebug-eval-last-sexp) |
| 3996 | (define-key map "\C-j" 'edebug-eval-print-last-sexp) | 3932 | (define-key map "\C-j" 'edebug-eval-print-last-sexp) |
| 3997 | map) | 3933 | map) |
| 3998 | "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.") | 3934 | "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.") |
| 3999 | 3935 | ||
| 4000 | (put 'edebug-eval-mode 'mode-class 'special) | 3936 | (put 'edebug-eval-mode 'mode-class 'special) |
| 4001 | 3937 | ||
| @@ -4022,32 +3958,32 @@ Global commands prefixed by `global-edebug-prefix': | |||
| 4022 | ;; since they depend on the backtrace looking a certain way. But | 3958 | ;; since they depend on the backtrace looking a certain way. But |
| 4023 | ;; edebug is not dependent on this, yet. | 3959 | ;; edebug is not dependent on this, yet. |
| 4024 | 3960 | ||
| 4025 | (defun edebug (&optional edebug-arg-mode &rest debugger-args) | 3961 | (defun edebug (&optional arg-mode &rest args) |
| 4026 | "Replacement for `debug'. | 3962 | "Replacement for `debug'. |
| 4027 | If we are running an edebugged function, show where we last were. | 3963 | If we are running an edebugged function, show where we last were. |
| 4028 | Otherwise call `debug' normally." | 3964 | Otherwise call `debug' normally." |
| 4029 | ;; (message "entered: %s depth: %s edebug-recursion-depth: %s" | 3965 | ;;(message "entered: %s depth: %s edebug-recursion-depth: %s" |
| 4030 | ;; edebug-entered (recursion-depth) edebug-recursion-depth) (sit-for 1) | 3966 | ;; edebug-entered (recursion-depth) edebug-recursion-depth) (sit-for 1) |
| 4031 | (if (and edebug-entered ; anything active? | 3967 | (if (and edebug-entered ; anything active? |
| 4032 | (eq (recursion-depth) edebug-recursion-depth)) | 3968 | (eq (recursion-depth) edebug-recursion-depth)) |
| 4033 | (let (;; Where were we before the error occurred? | 3969 | (let (;; Where were we before the error occurred? |
| 4034 | (edebug-offset-index (car edebug-offset-indices)) | 3970 | (offset-index (car edebug-offset-indices)) |
| 4035 | ;; Bind variables required by edebug-display | 3971 | (value (car args)) |
| 4036 | (edebug-value (car debugger-args)) | 3972 | ;; Bind variables required by edebug--display. |
| 4037 | edebug-breakpoints | 3973 | edebug-breakpoints |
| 4038 | edebug-break-data | 3974 | edebug-break-data |
| 4039 | edebug-break-condition | 3975 | edebug-break-condition |
| 4040 | edebug-global-break | 3976 | edebug-global-break |
| 4041 | (edebug-break (null edebug-arg-mode)) ;; if called explicitly | 3977 | (edebug-break (null arg-mode)) ;; If called explicitly. |
| 4042 | ) | 3978 | ) |
| 4043 | (edebug-display) | 3979 | (edebug--display value offset-index arg-mode) |
| 4044 | (if (eq edebug-arg-mode 'error) | 3980 | (if (eq arg-mode 'error) |
| 4045 | nil | 3981 | nil |
| 4046 | edebug-value)) | 3982 | value)) |
| 4047 | 3983 | ||
| 4048 | ;; Otherwise call debug normally. | 3984 | ;; Otherwise call debug normally. |
| 4049 | ;; Still need to remove extraneous edebug calls from stack. | 3985 | ;; Still need to remove extraneous edebug calls from stack. |
| 4050 | (apply 'debug edebug-arg-mode debugger-args) | 3986 | (apply 'debug arg-mode args) |
| 4051 | )) | 3987 | )) |
| 4052 | 3988 | ||
| 4053 | 3989 | ||
| @@ -4058,7 +3994,7 @@ Otherwise call `debug' normally." | |||
| 4058 | (null (buffer-name edebug-backtrace-buffer))) | 3994 | (null (buffer-name edebug-backtrace-buffer))) |
| 4059 | (setq edebug-backtrace-buffer | 3995 | (setq edebug-backtrace-buffer |
| 4060 | (generate-new-buffer "*Backtrace*")) | 3996 | (generate-new-buffer "*Backtrace*")) |
| 4061 | ;; else, could just display edebug-backtrace-buffer | 3997 | ;; Else, could just display edebug-backtrace-buffer. |
| 4062 | ) | 3998 | ) |
| 4063 | (with-output-to-temp-buffer (buffer-name edebug-backtrace-buffer) | 3999 | (with-output-to-temp-buffer (buffer-name edebug-backtrace-buffer) |
| 4064 | (setq edebug-backtrace-buffer standard-output) | 4000 | (setq edebug-backtrace-buffer standard-output) |
| @@ -4080,7 +4016,7 @@ Otherwise call `debug' normally." | |||
| 4080 | (beginning-of-line) | 4016 | (beginning-of-line) |
| 4081 | (cond | 4017 | (cond |
| 4082 | ((looking-at "^ \(edebug-after") | 4018 | ((looking-at "^ \(edebug-after") |
| 4083 | ;; Previous lines may contain code, so just delete this line | 4019 | ;; Previous lines may contain code, so just delete this line. |
| 4084 | (setq last-ok-point (point)) | 4020 | (setq last-ok-point (point)) |
| 4085 | (forward-line 1) | 4021 | (forward-line 1) |
| 4086 | (delete-region last-ok-point (point))) | 4022 | (delete-region last-ok-point (point))) |
| @@ -4098,15 +4034,15 @@ Otherwise call `debug' normally." | |||
| 4098 | "In buffer BUF-NAME, display FMT and ARGS at the end and make it visible. | 4034 | "In buffer BUF-NAME, display FMT and ARGS at the end and make it visible. |
| 4099 | The buffer is created if it does not exist. | 4035 | The buffer is created if it does not exist. |
| 4100 | You must include newlines in FMT to break lines, but one newline is appended." | 4036 | You must include newlines in FMT to break lines, but one newline is appended." |
| 4101 | ;; e.g. | 4037 | ;; e.g. |
| 4102 | ;; (edebug-trace-display "*trace-point*" | 4038 | ;; (edebug-trace-display "*trace-point*" |
| 4103 | ;; "saving: point = %s window-start = %s" | 4039 | ;; "saving: point = %s window-start = %s" |
| 4104 | ;; (point) (window-start)) | 4040 | ;; (point) (window-start)) |
| 4105 | (let* ((oldbuf (current-buffer)) | 4041 | (let* ((oldbuf (current-buffer)) |
| 4106 | (selected-window (selected-window)) | 4042 | (selected-window (selected-window)) |
| 4107 | (buffer (get-buffer-create buf-name)) | 4043 | (buffer (get-buffer-create buf-name)) |
| 4108 | buf-window) | 4044 | buf-window) |
| 4109 | ;; (message "before pop-to-buffer") (sit-for 1) | 4045 | ;; (message "before pop-to-buffer") (sit-for 1) |
| 4110 | (edebug-pop-to-buffer buffer) | 4046 | (edebug-pop-to-buffer buffer) |
| 4111 | (setq truncate-lines t) | 4047 | (setq truncate-lines t) |
| 4112 | (setq buf-window (selected-window)) | 4048 | (setq buf-window (selected-window)) |
| @@ -4116,8 +4052,8 @@ You must include newlines in FMT to break lines, but one newline is appended." | |||
| 4116 | (vertical-motion (- 1 (window-height))) | 4052 | (vertical-motion (- 1 (window-height))) |
| 4117 | (set-window-start buf-window (point)) | 4053 | (set-window-start buf-window (point)) |
| 4118 | (goto-char (point-max)) | 4054 | (goto-char (point-max)) |
| 4119 | ;; (set-window-point buf-window (point)) | 4055 | ;; (set-window-point buf-window (point)) |
| 4120 | ;; (edebug-sit-for 0) | 4056 | ;; (sit-for 0) |
| 4121 | (bury-buffer buffer) | 4057 | (bury-buffer buffer) |
| 4122 | (select-window selected-window) | 4058 | (select-window selected-window) |
| 4123 | (set-buffer oldbuf)) | 4059 | (set-buffer oldbuf)) |
| @@ -4180,8 +4116,8 @@ reinstrument it." | |||
| 4180 | ;; Insert all the indices for this line. | 4116 | ;; Insert all the indices for this line. |
| 4181 | (forward-line 1) | 4117 | (forward-line 1) |
| 4182 | (setq start-of-count-line (point) | 4118 | (setq start-of-count-line (point) |
| 4183 | first-index i ; really last index for line above this one. | 4119 | first-index i ; Really, last index for line above this one. |
| 4184 | last-count -1) ; cause first count to always appear. | 4120 | last-count -1) ; Cause first count to always appear. |
| 4185 | (insert ";#") | 4121 | (insert ";#") |
| 4186 | ;; i == first-index still | 4122 | ;; i == first-index still |
| 4187 | (while (<= (setq i (1+ i)) last-index) | 4123 | (while (<= (setq i (1+ i)) last-index) |
| @@ -4213,7 +4149,8 @@ It is removed when you hit any char." | |||
| 4213 | (let ((inhibit-read-only t)) | 4149 | (let ((inhibit-read-only t)) |
| 4214 | (undo-boundary) | 4150 | (undo-boundary) |
| 4215 | (edebug-display-freq-count) | 4151 | (edebug-display-freq-count) |
| 4216 | (setq unread-command-events (append unread-command-events (read-event))) | 4152 | (setq unread-command-events |
| 4153 | (append unread-command-events (list (read-event)))) | ||
| 4217 | ;; Yuck! This doesn't seem to work at all for me. | 4154 | ;; Yuck! This doesn't seem to work at all for me. |
| 4218 | (undo))) | 4155 | (undo))) |
| 4219 | 4156 | ||
| @@ -4325,80 +4262,6 @@ With prefix argument, make it a temporary breakpoint." | |||
| 4325 | 4262 | ||
| 4326 | (easy-menu-define edebug-menu edebug-mode-map "Edebug menus" edebug-mode-menus) | 4263 | (easy-menu-define edebug-menu edebug-mode-map "Edebug menus" edebug-mode-menus) |
| 4327 | 4264 | ||
| 4328 | ;;; Byte-compiler | ||
| 4329 | |||
| 4330 | ;; Extension for bytecomp to resolve undefined function references. | ||
| 4331 | ;; Requires new byte compiler. | ||
| 4332 | |||
| 4333 | (eval-when-compile | ||
| 4334 | ;; The body of eval-when-compile seems to get evaluated with eval-defun. | ||
| 4335 | ;; We only want to evaluate when actually byte compiling. | ||
| 4336 | ;; But it is OK to evaluate as long as byte-compiler has been loaded. | ||
| 4337 | (if (featurep 'byte-compile) (progn | ||
| 4338 | |||
| 4339 | (defun byte-compile-resolve-functions (funcs) | ||
| 4340 | "Say it is OK for the named functions to be unresolved." | ||
| 4341 | (mapc | ||
| 4342 | (function | ||
| 4343 | (lambda (func) | ||
| 4344 | (setq byte-compile-unresolved-functions | ||
| 4345 | (delq (assq func byte-compile-unresolved-functions) | ||
| 4346 | byte-compile-unresolved-functions)))) | ||
| 4347 | funcs) | ||
| 4348 | nil) | ||
| 4349 | |||
| 4350 | '(defun byte-compile-resolve-free-references (vars) | ||
| 4351 | "Say it is OK for the named variables to be referenced." | ||
| 4352 | (mapcar | ||
| 4353 | (function | ||
| 4354 | (lambda (var) | ||
| 4355 | (setq byte-compile-free-references | ||
| 4356 | (delq var byte-compile-free-references)))) | ||
| 4357 | vars) | ||
| 4358 | nil) | ||
| 4359 | |||
| 4360 | '(defun byte-compile-resolve-free-assignments (vars) | ||
| 4361 | "Say it is OK for the named variables to be assigned." | ||
| 4362 | (mapcar | ||
| 4363 | (function | ||
| 4364 | (lambda (var) | ||
| 4365 | (setq byte-compile-free-assignments | ||
| 4366 | (delq var byte-compile-free-assignments)))) | ||
| 4367 | vars) | ||
| 4368 | nil) | ||
| 4369 | |||
| 4370 | (byte-compile-resolve-functions | ||
| 4371 | '(reporter-submit-bug-report | ||
| 4372 | edebug-gensym ;; also in cl.el | ||
| 4373 | ;; Interfaces to standard functions. | ||
| 4374 | edebug-original-eval-defun | ||
| 4375 | edebug-original-read | ||
| 4376 | edebug-get-buffer-window | ||
| 4377 | edebug-mark | ||
| 4378 | edebug-mark-marker | ||
| 4379 | edebug-input-pending-p | ||
| 4380 | edebug-sit-for | ||
| 4381 | edebug-prin1-to-string | ||
| 4382 | edebug-format | ||
| 4383 | ;; lemacs | ||
| 4384 | zmacs-deactivate-region | ||
| 4385 | popup-menu | ||
| 4386 | ;; CL | ||
| 4387 | cl-macroexpand-all | ||
| 4388 | ;; And believe it or not, the byte compiler doesn't know about: | ||
| 4389 | byte-compile-resolve-functions | ||
| 4390 | )) | ||
| 4391 | |||
| 4392 | '(byte-compile-resolve-free-references | ||
| 4393 | '(read-expression-history | ||
| 4394 | read-expression-map)) | ||
| 4395 | |||
| 4396 | '(byte-compile-resolve-free-assignments | ||
| 4397 | '(read-expression-history)) | ||
| 4398 | |||
| 4399 | ))) | ||
| 4400 | |||
| 4401 | |||
| 4402 | ;;; Autoloading of Edebug accessories | 4265 | ;;; Autoloading of Edebug accessories |
| 4403 | 4266 | ||
| 4404 | ;; edebug-cl-read and cl-read are available from liberte@cs.uiuc.edu | 4267 | ;; edebug-cl-read and cl-read are available from liberte@cs.uiuc.edu |
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 4b02645e463..9e4de4c207f 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el | |||
| @@ -34,14 +34,6 @@ | |||
| 34 | ;;; Code: | 34 | ;;; Code: |
| 35 | (require 'comint) | 35 | (require 'comint) |
| 36 | 36 | ||
| 37 | ;;; For emacs < 24.3. | ||
| 38 | (require 'newcomment) | ||
| 39 | (eval-when-compile | ||
| 40 | (unless (fboundp 'setq-local) | ||
| 41 | (defmacro setq-local (var val) | ||
| 42 | "Set variable VAR to value VAL in current buffer." | ||
| 43 | (list 'set (list 'make-local-variable (list 'quote var)) val)))) | ||
| 44 | |||
| 45 | (defgroup octave nil | 37 | (defgroup octave nil |
| 46 | "Editing Octave code." | 38 | "Editing Octave code." |
| 47 | :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) | 39 | :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) |
| @@ -597,6 +589,17 @@ mode, set this to (\"-q\" \"--traditional\")." | |||
| 597 | ;; Could certainly do more font locking in inferior Octave ... | 589 | ;; Could certainly do more font locking in inferior Octave ... |
| 598 | "Additional expressions to highlight in Inferior Octave mode.") | 590 | "Additional expressions to highlight in Inferior Octave mode.") |
| 599 | 591 | ||
| 592 | |||
| 593 | ;;; Compatibility functions | ||
| 594 | (if (not (fboundp 'comint-line-beginning-position)) | ||
| 595 | ;; comint-line-beginning-position is defined in Emacs 21 | ||
| 596 | (defun comint-line-beginning-position () | ||
| 597 | "Returns the buffer position of the beginning of the line, after any prompt. | ||
| 598 | The prompt is assumed to be any text at the beginning of the line matching | ||
| 599 | the regular expression `comint-prompt-regexp', a buffer local variable." | ||
| 600 | (save-excursion (comint-bol nil) (point)))) | ||
| 601 | |||
| 602 | |||
| 600 | (defvar inferior-octave-output-list nil) | 603 | (defvar inferior-octave-output-list nil) |
| 601 | (defvar inferior-octave-output-string nil) | 604 | (defvar inferior-octave-output-string nil) |
| 602 | (defvar inferior-octave-receive-in-progress nil) | 605 | (defvar inferior-octave-receive-in-progress nil) |
| @@ -604,6 +607,9 @@ mode, set this to (\"-q\" \"--traditional\")." | |||
| 604 | (define-obsolete-variable-alias 'inferior-octave-startup-hook | 607 | (define-obsolete-variable-alias 'inferior-octave-startup-hook |
| 605 | 'inferior-octave-mode-hook "24.4") | 608 | 'inferior-octave-mode-hook "24.4") |
| 606 | 609 | ||
| 610 | (defvar inferior-octave-has-built-in-variables nil | ||
| 611 | "Non-nil means that Octave has built-in variables.") | ||
| 612 | |||
| 607 | (defvar inferior-octave-dynamic-complete-functions | 613 | (defvar inferior-octave-dynamic-complete-functions |
| 608 | '(inferior-octave-completion-at-point comint-filename-completion) | 614 | '(inferior-octave-completion-at-point comint-filename-completion) |
| 609 | "List of functions called to perform completion for inferior Octave. | 615 | "List of functions called to perform completion for inferior Octave. |
| @@ -695,11 +701,20 @@ startup file, `~/.emacs-octave'." | |||
| 695 | 'identity inferior-octave-output-list "\n") | 701 | 'identity inferior-octave-output-list "\n") |
| 696 | "\n")))) | 702 | "\n")))) |
| 697 | 703 | ||
| 704 | ;; Find out whether Octave has built-in variables. | ||
| 705 | (inferior-octave-send-list-and-digest | ||
| 706 | (list "exist \"LOADPATH\"\n")) | ||
| 707 | (setq inferior-octave-has-built-in-variables | ||
| 708 | (string-match "101$" (car inferior-octave-output-list))) | ||
| 709 | |||
| 698 | ;; An empty secondary prompt, as e.g. obtained by '--braindead', | 710 | ;; An empty secondary prompt, as e.g. obtained by '--braindead', |
| 699 | ;; means trouble. | 711 | ;; means trouble. |
| 700 | (inferior-octave-send-list-and-digest (list "PS2\n")) | 712 | (inferior-octave-send-list-and-digest (list "PS2\n")) |
| 701 | (if (string-match "\\(PS2\\|ans\\) = *$" (car inferior-octave-output-list)) | 713 | (if (string-match "\\(PS2\\|ans\\) = *$" (car inferior-octave-output-list)) |
| 702 | (inferior-octave-send-list-and-digest (list "PS2 (\"> \");\n"))) | 714 | (inferior-octave-send-list-and-digest |
| 715 | (list (if inferior-octave-has-built-in-variables | ||
| 716 | "PS2 = \"> \"\n" | ||
| 717 | "PS2 (\"> \");\n")))) | ||
| 703 | 718 | ||
| 704 | ;; O.k., now we are ready for the Inferior Octave startup commands. | 719 | ;; O.k., now we are ready for the Inferior Octave startup commands. |
| 705 | (let* (commands | 720 | (let* (commands |
| @@ -710,7 +725,9 @@ startup file, `~/.emacs-octave'." | |||
| 710 | (list "more off;\n" | 725 | (list "more off;\n" |
| 711 | (if (not (string-equal | 726 | (if (not (string-equal |
| 712 | inferior-octave-output-string ">> ")) | 727 | inferior-octave-output-string ">> ")) |
| 713 | "PS1 (\"\\\\s> \");\n") | 728 | (if inferior-octave-has-built-in-variables |
| 729 | "PS1=\"\\\\s> \";\n" | ||
| 730 | "PS1 (\"\\\\s> \");\n")) | ||
| 714 | (if (file-exists-p file) | 731 | (if (file-exists-p file) |
| 715 | (format "source (\"%s\");\n" file)))) | 732 | (format "source (\"%s\");\n" file)))) |
| 716 | (inferior-octave-send-list-and-digest commands)) | 733 | (inferior-octave-send-list-and-digest commands)) |
| @@ -42,8 +42,8 @@ LC_MESSAGES= | |||
| 42 | LANG= | 42 | LANG= |
| 43 | export LANGUAGE LC_ALL LC_MESSAGES LANG | 43 | export LANGUAGE LC_ALL LC_MESSAGES LANG |
| 44 | 44 | ||
| 45 | ## Remove unnecessary restrictions on file access. | 45 | ## Don't restrict access to any files. |
| 46 | umask 022 | 46 | umask 0 |
| 47 | 47 | ||
| 48 | update=yes | 48 | update=yes |
| 49 | check=yes | 49 | check=yes |