From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: describe-function and advised C functions Date: Tue, 03 Dec 2013 10:14:43 +0100 Message-ID: <87txeq8fek.fsf@tsdh.uni-koblenz.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386062211 10704 80.91.229.3 (3 Dec 2013 09:16:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Dec 2013 09:16:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 03 10:16:56 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vnm6C-0000B4-Ch for ged-emacs-devel@m.gmane.org; Tue, 03 Dec 2013 10:16:56 +0100 Original-Received: from localhost ([::1]:41185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnm6B-0006LH-Mc for ged-emacs-devel@m.gmane.org; Tue, 03 Dec 2013 04:16:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnm4C-0003Z7-PY for emacs-devel@gnu.org; Tue, 03 Dec 2013 04:15:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vnm45-0007C2-30 for emacs-devel@gnu.org; Tue, 03 Dec 2013 04:14:52 -0500 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:39700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnm44-0007Bo-Mh for emacs-devel@gnu.org; Tue, 03 Dec 2013 04:14:44 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id C6F1E1A83E3 for ; Tue, 3 Dec 2013 10:14:43 +0100 (CET) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E_vrkzBuA771 for ; Tue, 3 Dec 2013 10:14:43 +0100 (CET) X-CHKRCPT: Envelopesender noch tsdh@gnu.org Original-Received: from tsdh.uni-koblenz.de (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 775771A83E4 for ; Tue, 3 Dec 2013 10:14:43 +0100 (CET) Mail-Followup-To: emacs-devel@gnu.org User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 141.26.64.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166033 Archived-At: 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