;; printing, not while evaluating.
(defvar elisp--eval-defun-result)
(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.
(elisp--eval-defun-1
(macroexpand form)))))
(print-length eval-expression-print-length)
- (print-level eval-expression-print-level))
- (eval-region beg end standard-output
+ (print-level eval-expression-print-level)
+ (should-print (if (not edebugging) standard-output)))
+ (eval-region beg end should-print
(lambda (_ignore)
;; Skipping to the end of the specified region
;; will make eval-region return.
(call-interactively #'eval-last-sexp)
(should (equal (current-message) "66 (#o102, #x42, ?B)"))))))
+;;; eval-defun
+
+(ert-deftest eval-defun-prints-edebug-when-instrumented ()
+ (skip-unless (not noninteractive))
+ (with-temp-buffer
+ (let ((current-prefix-arg '(4)))
+ (erase-buffer) (insert "(defun foo ())") (message nil)
+ (call-interactively #'eval-defun)
+ (should (equal (current-message) "Edebug: foo")))))
+
;;; eldoc
(defun elisp-mode-tests--face-propertized-string (string)