Subject: Re: bug#1077: 23.0.60; x-create-frame: (wrong-type-argument number-or-marker-p nil)

From: Eli Zaretskii <[email-masked]>
Date: Tue, 30 Nov 2010 06:05:47 +0200

> From: "Drew Adams" <[email-masked]>
> Cc: <[email-masked]>
> Date: Mon, 29 Nov 2010 13:33:00 -0800
> 
> >  (define-key menu-bar-showhide-menu [menu-bar-mode]
> >    `(menu-item ,(purecopy "Menu-bar") toggle-menu-bar-mode-from-frame
> >  	      :help ,(purecopy "Turn menu-bar on/off")
> > -	      :button (:toggle . (> (frame-parameter nil 'menu-bar-lines) 0))))
> > +	      :button (:toggle . (> (frame-parameter (or menu-updating-frame
> > +                                                    (selected-frame))
> > +                                                'menu-bar-lines) 0))))
> 
> Ignore if this makes no sense; I'm not following the details of this, and I'm
> ignorant about menu-updating-frame.
> 
> Can menu-updating-frame be nil?

It can, but not when we are evaluating menu items as part of creating
a frame.  I left the reference to selected-frame for that very reason.

> In that case, don't we get the same error/bug?

I'm not sure.  I'm still trying to understand when and why did the
menu-bar-lines parameter got a nil value in the minibuffer frame's
parameters.  Depending on what I find, there could be an additional
change.  If this happens only in minibuffer frames, then the above
should be enough to fix the bug, because minibuffer frames without a
menu bar will never evaluate their menu items.