From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: [drew.adams@oracle.com:RE:weirddefadvicebugwithbyte-compilation] Date: Tue, 13 Dec 2005 19:45:27 -0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1134532037 30972 80.91.229.2 (14 Dec 2005 03:47:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2005 03:47:17 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 14 04:47:16 2005 Return-path: Original-Received: from [199.232.75.2] (helo=lists.gnu.org) by ciao.gmane.org with esmtp (Exim 4.43) id 1EmNav-0001H9-5s for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2005 04:46:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmNbU-00086q-Dd for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2005 22:46:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EmNal-00085B-Lr for emacs-devel@gnu.org; Tue, 13 Dec 2005 22:46:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EmNal-00084T-0Q for emacs-devel@gnu.org; Tue, 13 Dec 2005 22:46:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmNak-00084I-SL for emacs-devel@gnu.org; Tue, 13 Dec 2005 22:46:10 -0500 Original-Received: from [148.87.122.30] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EmNck-0004SQ-Tu for emacs-devel@gnu.org; Tue, 13 Dec 2005 22:48:15 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id jBE3jVmw019645 for ; Tue, 13 Dec 2005 20:45:31 -0700 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jBE3jVhs028686 for ; Tue, 13 Dec 2005 20:45:31 -0700 Original-Received: from dradamslap (dhcp-amer-rmdc-csvpn-gw5-141-144-106-118.vpn.oracle.com [141.144.106.118]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id jBE3jTjG028672 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Tue, 13 Dec 2005 20:45:30 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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 X-Broken-Reverse-DNS: no host name found for IP address 199.232.75.2 Xref: news.gmane.org gmane.emacs.devel:47671 Archived-At: Sorry - sending again as plain text. My mail client sends formatted text whenever I reply to a Unicode message. ------ > And I wonder about the behavior of the on-the-fly defadvice > byte-compiling. Again, I'm no doubt confused about that - I'd like > to understand what's happening there and why. See `ad-default-compilation-action'. Thanks very much. I never heard of that variable. Or, I may have read about it, but never paid adequate attention. Here is its doc string: Defines whether to compile advised definitions during activation. A value of `always' will result in unconditional compilation, `never' will always avoid compilation, `maybe' will compile if the byte-compiler is already loaded, and `like-original' will compile if the original definition of the advised function is compiled or a built-in function. Every other value will be interpreted as `maybe'. This variable will only be considered if the COMPILE argument of `ad-activate' was supplied as nil. The default value is `maybe', and that's the value I had. The doc string says that that means that activation will also compile - if the byte-compiler is already loaded. I have no idea what loads the byte compiler, or why its being loaded would be the criterion applied here, but I must assume that in my case it was already loaded, and that that is the default situation (?). How to tell if it is loaded? The doc string also says that this only happens if the COMPILE arg to ad-activate is nil. Well, I never explicitly called ad-activate, with or without a COMPILE arg - I used only defadvice. But I guess the `compile' FLAG for defadvice acts like the COMPILE arg to ad-activate in this regard (not mentioned in the doc string). Is that correct? Does this all seem a bit convoluted to anyone besides me? Does anyone else think that, at the very least, the doc string of defadvice should clarify that the meaning of not using the `compile' flag can be overridden by the value of `ad-default-compilation-action' - depending on that variable's value, and that it will be overridden by the default value (`maybe') in the default configuration (byte-compiler loaded)? What goes for the doc string of defadvice also goes for the description in Info (Elisp). Apparently, the already elaborate description of defadvice in Info (node "Defining Advice") is far from being enough for someone to understand how to use defadvice in even a simple case.