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:41:59 -0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1134531803 30536 80.91.229.2 (14 Dec 2005 03:43:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2005 03:43:23 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 14 04:43:20 2005 Return-path: Original-Received: from [199.232.75.2] (helo=lists.gnu.org) by ciao.gmane.org with esmtp (Exim 4.43) id 1EmNX0-00005F-8F for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2005 04:42:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmNXZ-0005p6-H7 for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2005 22:42:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EmNXP-0005om-PG for emacs-devel@gnu.org; Tue, 13 Dec 2005 22:42:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EmNXP-0005oO-23 for emacs-devel@gnu.org; Tue, 13 Dec 2005 22:42:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmNXO-0005oF-QR for emacs-devel@gnu.org; Tue, 13 Dec 2005 22:42:42 -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 1EmNZO-0003jp-Oh for emacs-devel@gnu.org; Tue, 13 Dec 2005 22:44:47 -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 jBE3g3Ng014681 for ; Tue, 13 Dec 2005 20:42:03 -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 jBE3g38M027155 for ; Tue, 13 Dec 2005 20:42:03 -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 jBE3g0qM027133 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Tue, 13 Dec 2005 20:42:02 -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:47669 Archived-At: > 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. =20 See `ad-default-compilation-action'. =20 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.