[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21072: Brave new mark-defun (and a testing tool)

From: npostavs
Subject: bug#21072: Brave new mark-defun (and a testing tool)
Date: Sun, 30 Apr 2017 15:18:11 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>>> 1. What is the difference between (debug t) and (debug form body)?  From
>>>> my understanding of the manual, there seems to be none.
>>> Indeed, no significant difference.
>> Oops, I meant (debug sexp body), then I changed it for some reason and
>> forgot to change back to the correct thing.
> Ah that changes everything: (debug (sexp body)) is quite different from
> (debug t) since it says that the first argument is not an expression
> (and hence shouldn't be instrumented).

I guess it's related to the fact that the first argument is evaluated by
the macro itself at compile time, with (debug t) or (debug form body) I
get an error when trying to instrument one of tests using that macro:

Debugger entered--Lisp error: (wrong-type-argument char-or-string-p 
(edebug-after 0 3 mark-defun-test-buffer))
  insert((edebug-after 0 3 mark-defun-test-buffer))
  (progn (insert (cond ((symbolp contents) (symbol-value contents)) (t 
contents))) (goto-char (point-min)) [...])
  (unwind-protect [...] (and (buffer-name temp-buffer) (kill-buffer 
  (save-current-buffer (set-buffer temp-buffer) [...])
  (let ((temp-buffer (generate-new-buffer " *temp*"))) [...])
  (let* ((var-pos nil) (text (let ((temp-buffer (generate-new-buffer " 
*temp*"))) [...]))) [...])
  (closure (t) (contents &rest body) "Create an `emacs-lisp-mode' enabled temp 
buffer with CONTENTS[...]
  macroexpand((elisp-tests-with-temp-buffer [...]
  apply(edebug-eval-defun (4))
  funcall-interactively(eval-defun (4))
  call-interactively(eval-defun nil nil)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]