once and then reset `edebug-setup-hook' to nil. You could use this
to load up Edebug specifications associated with a package you are
using, but only when you also use Edebug."
- :type 'hook
- :group 'edebug)
+ :type 'hook)
;; edebug-all-defs and edebug-all-forms need to be autoloaded
;; because the byte compiler binds them; as a result, if edebug
variable. You may wish to make it local to each buffer with
\(make-local-variable \\='edebug-all-defs) in your
`emacs-lisp-mode-hook'."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
;; edebug-all-defs and edebug-all-forms need to be autoloaded
;; because the byte compiler binds them; as a result, if edebug
"Non-nil means evaluation of all forms will instrument for Edebug.
This doesn't apply to loading or evaluations in the minibuffer.
Use the command `edebug-all-forms' to toggle the value of this option."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
(defcustom edebug-eval-macro-args nil
"Non-nil means all macro call arguments may be evaluated.
For each macro, an `edebug-form-spec' overrides this option.
So to specify exceptions for macros that have some arguments evaluated
and some not, use `def-edebug-spec' to specify an `edebug-form-spec'."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
(defcustom edebug-max-depth 150
"Maximum recursion depth when instrumenting code.
Make this limit larger to countermand that, but you may also need to
increase `max-lisp-eval-depth' and `max-specpdl-size'."
:type 'integer
- :group 'edebug
:version "26.1")
(defcustom edebug-save-windows t
restored.
`edebug-toggle-save-windows' may be used to change this variable."
- :type '(choice boolean (repeat string))
- :group 'edebug)
+ :type '(choice boolean (repeat string)))
(defcustom edebug-save-displayed-buffer-points nil
"If non-nil, save and restore point in all displayed buffers.
Saving and restoring point in all buffers is expensive, since it
requires selecting each window twice, so enable this only if you
need it."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
(defcustom edebug-initial-mode 'step
"Initial execution mode for Edebug, if non-nil.
:type '(choice (const step) (const next) (const go)
(const Go-nonstop) (const trace)
(const Trace-fast) (const continue)
- (const Continue-fast))
- :group 'edebug)
+ (const Continue-fast)))
(defcustom edebug-trace nil
"Non-nil means display a trace of function entry and exit.
You can customize by replacing functions `edebug-print-trace-before'
and `edebug-print-trace-after'."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
(defcustom edebug-test-coverage nil
"If non-nil, Edebug tests coverage of all expressions debugged.
Use `edebug-display-freq-count' to display the frequency count and
coverage information for a definition."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
(defcustom edebug-continue-kbd-macro nil
"If non-nil, continue defining or executing any keyboard macro.
Use this with caution since it is not debugged."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
(defcustom edebug-print-length 50
"If non-nil, default value of `print-length' for printing results in Edebug."
- :type '(choice integer (const nil))
- :group 'edebug)
+ :type '(choice integer (const nil)))
(defcustom edebug-print-level 50
"If non-nil, default value of `print-level' for printing results in Edebug."
- :type '(choice integer (const nil))
- :group 'edebug)
+ :type '(choice integer (const nil)))
(defcustom edebug-print-circle t
"If non-nil, default value of `print-circle' for printing results in Edebug."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
(defcustom edebug-unwrap-results nil
"Non-nil if Edebug should unwrap results of expressions.
That is, Edebug will try to remove its own instrumentation from the result.
This is useful when debugging macros where the results of expressions
are instrumented expressions."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
(defcustom edebug-on-error t
"Value bound to `debug-on-error' while Edebug is active.
(repeat :menu-tag "When"
:value (nil)
(symbol :format "%v"))
- (const :tag "always" t))
- :group 'edebug)
+ (const :tag "always" t)))
(defcustom edebug-on-quit t
"Value bound to `debug-on-quit' while Edebug is active."
- :type 'boolean
- :group 'edebug)
+ :type 'boolean)
(defcustom edebug-global-break-condition nil
"If non-nil, an expression to test for at every stop point.
If the result is non-nil, then break. Errors are ignored."
:type 'sexp
- :risky t
- :group 'edebug)
+ :risky t)
(defcustom edebug-sit-for-seconds 1
"Number of seconds to pause when execution mode is `trace' or `continue'."
- :type 'number
- :group 'edebug)
+ :type 'number)
(defcustom edebug-sit-on-break t
"Whether or not to pause for `edebug-sit-for-seconds' on reaching a break."
:type 'boolean
- :group 'edebug
:version "26.1")
;;; Form spec utilities.
(edebug-read-top-level-form)))))
+(defvar edebug-active nil) ;; Non-nil when edebug is active
+
(defun edebug-read-top-level-form ()
- (let ((starting-point (point)))
+ (let ((starting-point (point))
+ ;; Don't enter Edebug while doing that, in case we're trying to
+ ;; instrument things like end-of-defun.
+ (edebug-active t))
(end-of-defun)
(beginning-of-defun)
(prog1
(defun edebug-uninstall-read-eval-functions ()
(interactive)
(remove-function load-read-function #'edebug--read)
- (advice-remove 'eval-defun 'edebug-eval-defun))
+ (advice-remove 'eval-defun #'edebug-eval-defun))
;;; Edebug internal data
;;; The debugger itself
-(defvar edebug-active nil) ;; Non-nil when edebug is active
-
(defvar edebug-stack nil)
;; Stack of active functions evaluated via edebug.
;; Should be nil at the top level.
`edebug-after'."
(cl-letf* ((behavior (get func 'edebug-behavior))
(functions (cdr (assoc behavior edebug-behavior-alist)))
- ((symbol-function #'edebug-before) (nth 1 functions))
- ((symbol-function #'edebug-after) (nth 2 functions)))
+ ((symbol-function 'edebug-before) (nth 1 functions))
+ ((symbol-function 'edebug-after) (nth 2 functions)))
(funcall (nth 0 functions) func args body)))
(defun edebug-default-enter (function args body)
(debug-on-error (or debug-on-error edebug-on-error))
(debug-on-quit edebug-on-quit))
(unwind-protect
- (let ((signal-hook-function 'edebug-signal))
+ (let ((signal-hook-function #'edebug-signal))
(setq edebug-execution-mode (or edebug-next-execution-mode
edebug-initial-mode
edebug-execution-mode)
(recursive-edit) ; <<<<<<<<<< Recursive edit
;; Do the following, even if quit occurs.
- (setq signal-hook-function 'edebug-signal)
+ (setq signal-hook-function #'edebug-signal)
(if edebug-backtrace-buffer
(kill-buffer edebug-backtrace-buffer))
(if (consp setting)
(set (car setting) (cdr setting))
(kill-local-variable setting))))
- (remove-hook 'kill-buffer-hook 'edebug-kill-buffer t))
+ (remove-hook 'kill-buffer-hook #'edebug-kill-buffer t))
(pcase-dolist (`(,var . ,val) '((buffer-read-only . t)))
(push
(if (local-variable-p var) (cons var (symbol-value var)) var)
(set (make-local-variable var) val))
;; Append `edebug-kill-buffer' to the hook to avoid interfering with
;; other entries that are unguarded against deleted buffer.
- (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t)))
+ (add-hook 'kill-buffer-hook #'edebug-kill-buffer t t)))
(defun edebug-kill-buffer ()
"Used on `kill-buffer-hook' when Edebug is operating in a buffer of Lisp code."
(pop-to-buffer edebug-backtrace-buffer)
(unless (derived-mode-p 'backtrace-mode)
(backtrace-mode)
- (add-hook 'backtrace-goto-source-functions 'edebug--backtrace-goto-source))
+ (add-hook 'backtrace-goto-source-functions #'edebug--backtrace-goto-source))
(setq edebug-instrumented-backtrace-frames
(backtrace-get-frames 'edebug-debugger
:constructor #'edebug--make-frame)
;; We still want to run unload-feature to completion
(run-with-idle-timer 0 nil #'(lambda () (unload-feature 'edebug)))))
(remove-hook 'called-interactively-p-functions
- 'edebug--called-interactively-skip)
- (remove-hook 'cl-read-load-hooks 'edebug--require-cl-read)
+ #'edebug--called-interactively-skip)
+ (remove-hook 'cl-read-load-hooks #'edebug--require-cl-read)
(edebug-uninstall-read-eval-functions)
;; Continue standard unloading.
nil)