Subject: bug#50245: 28.0.50; Instrumenting a function does not show "Edebug:" in the echo area

From: Stefan Monnier <[email-masked]>
Date: Thu, 25 Aug 2022 08:47:54 -0400

>> Here's a new version of the patch, which addresses Stefan's feedback.
>
> Thanks.  One question, tho:
>
>> @@ -1643,7 +1643,10 @@ elisp--eval-defun
>>    ;; FIXME: the print-length/level bindings should only be applied while
>>    ;; printing, not while evaluating.
>>    (defvar elisp--eval-defun-result)
>> +  ;; FIXME: This Edebug dependency is undesirable.  See bug#50245
>> +  (defvar edebug-all-defs)
>>    (let ((debug-on-error eval-expression-debug-on-error)
>> +        (edebugging edebug-all-defs)
>>          elisp--eval-defun-result)
>>      (save-excursion
>>        ;; Arrange for eval-region to "read" the (possibly) altered form.
>
> What makes us think that `edebug-all-defs` will always be defined when
> we get here?  Doesn't this code signal an error if called before
> edebug.el is loaded (e.g. in the case of `emacs -Q` soon followed by
> a plain `C-M-x`)?

IOW, I'd remove the `defvar` and use (bound-and-true-p
edebug-all-defs) instead.

        Stefan