[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13305: 24.2; describe-function gives incorrect function location inf
From: |
Stefan Monnier |
Subject: |
bug#13305: 24.2; describe-function gives incorrect function location information (for functions changed in a hook?) |
Date: |
Thu, 03 Jan 2013 12:22:34 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> For some reason I was thinking that changes to interactive didn't
> work properly with advice. Just using defun can be more convenient than
> advice, however, when you are in a hurry for a temporary patch.
Fine, but don't expect everything else to handle it just right.
> It's too bad there isn't a macro for replace-defun that acts
> syntactically identical to defun except that it uses advice to patch
> lazily the built-in (e.g., part of Emacs distribution) function.
Instead of (replace-defun foo (ARGS) BODY), you can write
(advice-add foo :around (lambda (_ignore ARGS) BODY))
If needed we could add a :replace to advice-add, so it'd be
(advice-add foo :replace (lambda (ARGS) BODY)), but I'm not convinced
it's worth the trouble.
Stefan