GNU bug report logs - #20718
25.0.50; find-function fails on advised subrs (again)

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Tue, 2 Jun 2015 12:50:03 UTC

Severity: normal

Found in version 25.0.50

Fixed in version 25.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: michael_heerdegen <at> web.de, 20718 <at> debbugs.gnu.org
Subject: bug#20718: 25.0.50; find-function fails on advised subrs (again)
Date: Thu, 04 Jun 2015 11:55:32 -0400
> Something like the patch below should fix it, but then the function
> returns a #<subr> object, instead of function symbol, and several callers
> seem to depend on the return value being the latter (because they want to
> call symbol-function on it).

Indeed, even its docstring says that it returns "the original function
symbol", and that's basically meaningless in general (and in the
nadvice case in particular).

So the callers will need to be adjusted.


        Stefan


> diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
> index 7ea13d4..75fdfc7 100644
> --- a/lisp/emacs-lisp/find-func.el
> +++ b/lisp/emacs-lisp/find-func.el
> @@ -192,9 +192,9 @@ defined in C.")
>    "Return the original function symbol of an advised function FUNC.
>  If FUNC is not the symbol of an advised function, just returns FUNC."
>    (or (and (symbolp func)
> -	   (featurep 'advice)
> -	   (let ((ofunc (cdr (assq 'origname (ad-get-advice-info func)))))
> -	     (and (fboundp ofunc) ofunc)))
> +	   (featurep 'nadvice)
> +	   (let ((ofunc (advice--symbol-function func)))
> +	     (and (advice--p ofunc) (advice--cd*r ofunc))))
>        func))

>  (defun find-function-C-source (fun-or-var file type)







This bug report was last modified 9 years and 353 days ago.

Previous Next


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