From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.devel Subject: Re: trunk defadvice doesn't preserve original function Date: Tue, 23 Oct 2007 15:06:31 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1193119611 6440 80.91.229.12 (23 Oct 2007 06:06:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Oct 2007 06:06:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 23 08:06:52 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IkCuh-0003Fa-08 for ged-emacs-devel@m.gmane.org; Tue, 23 Oct 2007 08:06:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IkCuZ-0003QZ-6B for ged-emacs-devel@m.gmane.org; Tue, 23 Oct 2007 02:06:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IkCuV-0003Nn-Pe for emacs-devel@gnu.org; Tue, 23 Oct 2007 02:06:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IkCuV-0003Mk-3g for emacs-devel@gnu.org; Tue, 23 Oct 2007 02:06:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IkCuU-0003Mc-Vu for emacs-devel@gnu.org; Tue, 23 Oct 2007 02:06:39 -0400 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IkCuU-0008Ec-Ag for emacs-devel@gnu.org; Tue, 23 Oct 2007 02:06:38 -0400 Original-Received: from [66.225.201.151] (port=39259 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.68) (envelope-from ) id 1IkCv7-0005HM-5a for emacs-devel@gnu.org; Tue, 23 Oct 2007 01:07:17 -0500 X-Hashcash: 1:20:071023:emacs-devel@gnu.org::Moym3aOv+ar0ECiu:0000000000000000000000000000000000000000000kqa X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:vhd2ttt+QBxf7rqAHf38WbUlHEY= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:81506 Archived-At: >>>>> Katsumi Yamaoka wrote: > Performing (defadvice foo ...) twice breaks `foo' if bytecomp > has been loaded. I found that the cause is: 2007-10-20 Juanma Barranquero * doc.c (Fdocumentation): Check for advice in all cases. This made `ad-real-documentation' (i.e. #) return the return value of `ad-make-advised-docstring', while it was that of `ad-make-advised-definition-docstring' before. Because of this change, the return value of `ad-real-documentation' does not have the `ad-advice-info' text property now, and `ad-advised-definition-p' returns nil even for an advised function. This is why `defadvice' always behaves as is used for the first time for a function. Here is a patch: 2007-10-23 Katsumi Yamaoka * emacs-lisp/advice.el (ad-make-advised-docstring): Add ad-advice-info text property to doc string. *** advice.el~ Tue Oct 16 07:45:57 2007 --- advice.el Tue Oct 23 06:06:00 2007 *************** *** 3004,3011 **** (if advice-docstring (push advice-docstring paragraphs)))) (setq origdoc (if paragraphs ! ;; separate paragraphs with blank lines: ! (mapconcat 'identity (nreverse paragraphs) "\n\n"))) (help-add-fundoc-usage origdoc usage))) (defun ad-make-plain-docstring (function) --- 3004,3013 ---- (if advice-docstring (push advice-docstring paragraphs)))) (setq origdoc (if paragraphs ! (propertize ! ;; separate paragraphs with blank lines: ! (mapconcat 'identity (nreverse paragraphs) "\n\n") ! 'ad-advice-info function))) (help-add-fundoc-usage origdoc usage))) (defun ad-make-plain-docstring (function)