unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Gemini Lasswell <gazally@runbox.com>
Cc: 25316@debbugs.gnu.org
Subject: bug#25316: Patch for bug#25316: 26.0.50; Bugs in testcover-reinstrument
Date: Sat, 30 Sep 2017 10:40:09 -0400	[thread overview]
Message-ID: <87lgkwdzcm.fsf@users.sourceforge.net> (raw)
In-Reply-To: <87bmlybfjp.fsf@runbox.com> (Gemini Lasswell's message of "Mon, 25 Sep 2017 15:04:58 -0700")

Gemini Lasswell <gazally@runbox.com> writes:

> (edebug-enter): New function which changes behavior of Edebug based
> on symbol property 'edebug-behavior and edebug-behavior-alist.

Those should be wrapped in quotes as in `edebug-behavior' and
`edebug-behavior-alist'.

> -(defun edebug-enter (function args body)
> +(defun edebug-enter (func args body)
> +  "Enter Edebug for a function.
> +FUNC should be the symbol with the Edebug information, ARGS is
> +the list of arguments and BODY is the code.
> +
> +Look up the `edebug-behavior' for FUNC in `edebug-behavior-alist'
> +and run its entry function, and set up `edebug-before' and
> +`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)))
> +    (funcall (nth 0 functions) func args body)))

Overriding the function-definition of edebug-before and edebug-after
doesn't seem very clean.  It would be better to have an
edebug-before-function which is `funcall'ed I think (I know your patch
didn't introduce this, it just makes it more obvious.  Perhaps it could
be addressed later).

>  (defun edebug-run-slow ()
> -  (defalias 'edebug-before 'edebug-slow-before)
> -  (defalias 'edebug-after 'edebug-slow-after))
> +  "Set up Edebug's normal behavior."
> +  (setf (cdr (assq 'edebug edebug-behavior-alist))
> +        '(edebug-default-enter edebug-slow-before edebug-slow-after)))


> +(defun testcover-analyze-coverage (form)

> +  (pcase form

> +    (`(quote . ,_)
> +     ;; A quoted form is 1value. Edebug could have instrumented
> +     ;; something inside the form if an Edebug spec contained a quote.
> +     ;; It's also possible that the quoted form is a circular object.
> +     ;; To avoid infinite recursion, don't examine quoted objects.
> +     ;; This will cause the coverage marks on an instrumented quoted
> +     ;; form to look odd. See bug#25316.
> +     '1value)

Missed double spacing again.

> +    ((or `(\` ,bq-form) `(\` . ,bq-form))

Isn't only the first of these is needed?  (read "`foo") ;=> (\` foo)

> +(defun testcover-analyze-coverage-wrapped-form (form)

> +  (pcase form

> +    ((or `(\` ,bq-form) `(\` . ,bq-form))

As above.






  parent reply	other threads:[~2017-09-30 14:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01  0:39 bug#25316: 26.0.50; Bugs in testcover-reinstrument Gemini Lasswell
2017-09-25 22:04 ` bug#25316: Patch for " Gemini Lasswell
2017-09-29 10:05   ` Eli Zaretskii
2017-10-03 19:17     ` Gemini Lasswell
2017-10-04  5:55       ` Eli Zaretskii
2017-09-30 14:40   ` Noam Postavsky [this message]
2017-10-03 17:32     ` Gemini Lasswell
2017-10-08 23:38   ` Gemini Lasswell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lgkwdzcm.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=25316@debbugs.gnu.org \
    --cc=gazally@runbox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).