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 10:17:39 -0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1134327761 2312 80.91.229.2 (11 Dec 2005 19:02:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2005 19:02:41 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 20:02:32 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ElWRU-0004ba-AP for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2005 20:01:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ElWRv-0000c4-GD for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2005 14:01:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ElVmI-0001Gc-HV for emacs-devel@gnu.org; Sun, 11 Dec 2005 13:18:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ElVmG-0001EE-8Y for emacs-devel@gnu.org; Sun, 11 Dec 2005 13:18:29 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ElVmF-0001Do-Ve for emacs-devel@gnu.org; Sun, 11 Dec 2005 13:18:28 -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 1ElVnq-0005D5-5b for emacs-devel@gnu.org; Sun, 11 Dec 2005 13:20:06 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by agminet01.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jBBIZRuv008037 for ; Sun, 11 Dec 2005 12:35:27 -0600 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 jBBIHjlh020605 for ; Sun, 11 Dec 2005 11:17:45 -0700 Original-Received: from dradamslap (dhcp-amer-whq-csvpn-gw3-141-144-81-104.vpn.oracle.com [141.144.81.104]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id jBBIHiol020594 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sun, 11 Dec 2005 11:17:45 -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:47471 Archived-At: Debugger entered--Lisp error: (void-variable my-mode) I think I see the reason for this error: (let ((map (make-sparse-keymap "II"))) (setq mymap (make-sparse-keymap)) (define-key menu-bar-search-menu [ise] '("" . ise)) (put 'ise 'menu-enable '(and my-mode)) The menu command's enable condition tests a void variable. So this error seems to be correct. See my previous message - I already indicated that the menu-enable is testing a void variable. The question is why it is void. There are a couple of questions involved (see my email), including how define-minor-mode works. My understanding was that define-minor-mode was designed to replace an explicit defcustom or defvar for the mode variable (my-mode), in addition to replacing an explicit definition of the minor-mode toggle function. If that is the intention, then this case seems to point to a hole in the implementation (?) - users of define-minor-mode must nevertheless be concerned with also defining the mode variable, if they explicitly use it in a menu-enable property. And, again, there seem to be other things going on in this case, as well: If I remove any part of the code I submitted with the bug, the bug goes away. This suggests that it involves: 1) the mode-line indication (minor-mode-map-alist), 2) the menu-enable condition (that's the code that provokes the error message by evaluating the unbound variable), 3) the keymap, 4) the defadvice in foo.el, and 5) the defadvice in bar.el.