Subject: Re: bug#18897: [PATCH] using advice-add

From: Stefan Monnier <[email-masked]>
Date: Thu, 30 Oct 2014 00:04:10 -0400

> Here's a patch that replaces the defalias with an advice-add.

Looks good, please install.  See comments below.

> * lisp/emacs-lisp/eieio.el (eieio-edebug-prin1-to-string): Modify
>   function for use as advice.

Commit messages describe modifications, so "Modify" is
a redundant verb.  I'd say "Adjust for use as advice".

>   (edebug-setup-hook): Add `eieio-edebug-prin1-to-string' as advice on
>   `edebug-prin1-to-string'.

I'd just say "Advise edebug-prin1-to-string".

> +	    (advice-add #'edebug-prin1-to-string
> +			:around #'eieio-edebug-prin1-to-string)))
 
This will work, but is conceptually wrong.  It should be:

	    (advice-add 'edebug-prin1-to-string
			:around #'eieio-edebug-prin1-to-string)))

The thing that is modified by `advice-add' is the `symbol-function'
field of the `edebug-prin1-to-string' symbol, so the first argument of
advice-add should be a symbol, not a function.

        Stefan