[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#18897: [PATCH] using advice-add
From: |
Stefan Monnier |
Subject: |
bug#18897: [PATCH] using advice-add |
Date: |
Thu, 30 Oct 2014 00:04:10 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> 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