emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

describe-function and advised C functions


From: Tassilo Horn
Subject: describe-function and advised C functions
Date: Tue, 03 Dec 2013 10:14:43 +0100
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]