unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* describe-function and advised C functions
@ 2013-12-03  9:14 Tassilo Horn
  2013-12-03 13:51 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Tassilo Horn @ 2013-12-03  9:14 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-12-07 17:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-03  9:14 describe-function and advised C functions Tassilo Horn
2013-12-03 13:51 ` 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

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