all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: michael_heerdegen@web.de, 20718@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	[thread overview]
Message-ID: <jwvfv678o7k.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <556F9753.7090807@yandex.ru> (Dmitry Gutov's message of "Thu, 4 Jun 2015 03:09:55 +0300")

> 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)








  reply	other threads:[~2015-06-04 15:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 12:49 bug#20718: 25.0.50; find-function fails on advised subrs (again) Michael Heerdegen
2015-06-04  0:09 ` Dmitry Gutov
2015-06-04 15:55   ` Stefan Monnier [this message]
2015-06-04 22:36     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvfv678o7k.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20718@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.