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: weird defadvice bug withbyte-compilation] Date: Sun, 11 Dec 2005 13:35:46 -0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1134337795 32179 80.91.229.2 (11 Dec 2005 21:49:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2005 21:49:55 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 22:49:49 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ElZ2p-0001A7-BS for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2005 22:47:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ElYwu-00011o-2d for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2005 16:41:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ElYrr-0005pG-42 for emacs-devel@gnu.org; Sun, 11 Dec 2005 16:36:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ElYrp-0005nv-4a for emacs-devel@gnu.org; Sun, 11 Dec 2005 16:36:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ElYro-0005ng-Ox for emacs-devel@gnu.org; Sun, 11 Dec 2005 16:36:24 -0500 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1ElYtQ-000851-Es for emacs-devel@gnu.org; Sun, 11 Dec 2005 16:38:04 -0500 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by agminet01.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jBBLras9017426 for ; Sun, 11 Dec 2005 15:53:36 -0600 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jBBLZros012751 for ; Sun, 11 Dec 2005 14:35:53 -0700 Original-Received: from dradamslap (dhcp-amer-whq-csvpn-gw3-141-144-81-104.vpn.oracle.com [141.144.81.104]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id jBBLZpvU012741 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sun, 11 Dec 2005 14:35:53 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 In-Reply-To: Importance: Normal 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 Xref: news.gmane.org gmane.emacs.devel:47480 Archived-At: Does this make sense? It does, as far as I can tell. I don't understand all of it, however, I admit. I still don't understand, for instance: 1. why byte-compiling the defadvice in bar.el would eval my-mode (my-mode does not even appear in bar.el) 2. why evaling the defadvice in foo.el would eval my-mode (the BODY of defadvice is not supposed to be quoted) 3. what the interaction is between the two defadvice's in the two files, and how they relate to byte-compiling 4. how to use define-minor-mode in connection with the menu-enable keymap stuff 5. why selecting (require 'foo) and doing eval-region does not manifest the bug, but putting the cursor after (require 'foo) and doing `C-x C-e' does manifest the bug. Wrt #3, only the defadvice in bar.el has `compile', and that defadvice evals without error. It is when you eval the (require 'foo) that the unbound error occurs. Also, neither advised function is actually called. Wrt #4, the original context uses define-minor-mode to define variable my-mode. I also forgot to mention that I turn on the minor mode in my .emacs (by calling the my-mode function), before loading the libraries in question, and the library that corresponds to foo.el does this at the end: ;; Apparently, this is needed if the initial value is non-nil. ;; Otherwise, the lighter shows the mode as on, but it is not on. (if my-mode (my-mode 1)) ---- BTW (doc bug?) - The doc string for defadvice does not really explain what BODY is for - it says only this: "Any s-expression". Neither the doc string nor the Info explanation of BODY-FORMS explains that it should not be quoted (it is not evaled by defadvice). I would expect both doc string and Info to make reference to the body forms when describing the overall effect and perhaps also when describing the other individual args.