unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: emacs-devel@gnu.org
Subject: describe-function and advised C functions
Date: Tue, 03 Dec 2013 10:14:43 +0100	[thread overview]
Message-ID: <87txeq8fek.fsf@tsdh.uni-koblenz.de> (raw)

Hi all,

when advising a C function foo, C-h f foo just says that "foo is an
compiled lisp function" without a link to the source.

With Emacs 23 and 24.3, it said "foo is a built-in function in `C source
code'."  which is much more helpful.

The following patch restores that behavior for the current trunk.  Good
to commit?

--8<---------------cut here---------------start------------->8---
=== modified file 'lisp/help-fns.el'
--- lisp/help-fns.el	2013-06-15 01:12:05 +0000
+++ lisp/help-fns.el	2013-12-03 09:03:21 +0000
@@ -541,9 +541,10 @@
 		     (and (fboundp origname) origname)))
 	      function))
 	 ;; Get the real definition.
-	 (def (if (symbolp real-function)
-		  (symbol-function real-function)
-		function))
+	 (def (cond
+	       (advised (ad-get-orig-definition real-function))
+	       ((symbolp real-function) (symbol-function real-function))
+	       (t function)))
 	 (aliased (symbolp def))
 	 (real-def (if aliased
 		       (let ((f def))
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo



             reply	other threads:[~2013-12-03  9:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  9:14 Tassilo Horn [this message]
2013-12-03 13:51 ` describe-function and advised C functions Stefan Monnier
2013-12-04 10:54   ` Tassilo Horn
2013-12-04 14:05     ` Tassilo Horn
2013-12-04 19:18       ` Johan Bockgård
2013-12-05  2:38       ` Stefan Monnier
2013-12-05  9:52         ` Tassilo Horn
2013-12-07 17:08           ` Tassilo Horn

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87txeq8fek.fsf@tsdh.uni-koblenz.de \
    --to=tsdh@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).