GNU bug report logs - #13305
24.2; describe-function gives incorrect function location information (for functions changed in a hook?)

Previous Next

Package: emacs;

Reported by: mdl <at> alum.mit.edu

Date: Sat, 29 Dec 2012 20:18:01 UTC

Severity: minor

Tags: wontfix

Found in version 24.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #25 received at 13305 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Mark Lillibridge <mdl <at> alum.mit.edu>
Cc: 13305 <at> debbugs.gnu.org
Subject: Re: 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
>     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




This bug report was last modified 11 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.