[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: address@hidden: RE: weird defadvice bug withbyte-compilation]

From: Drew Adams
Subject: RE: address@hidden: RE: weird defadvice bug withbyte-compilation]
Date: Sun, 11 Dec 2005 10:17:39 -0800

        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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]