Subject: bug#19728: 25.0.50; (wrong-type-argument frame-live-p #<dead frame *scratch* 0b54c8d8>)

From: Eli Zaretskii <[email-masked]>
Date: Sat, 31 Jan 2015 15:29:49 +0200

> Date: Thu, 29 Jan 2015 09:46:35 -0800 (PST)
> From: Drew Adams <[email-masked]>
> Cc: [email-masked]
> 
> > Any idea how come redisplay got to call
> > menu-bar-non-minibuffer-window-p?
> 
> I do have this in my setup - these are the only occurrences of
> that function in my code:
> 
> ;; Add for Emacs < 22.  Rename item otherwise.
> (define-key menu-bar-file-menu [new-file]
>   '(menu-item "New File..." find-file
>     :enable (or (not (fboundp 'menu-bar-non-minibuffer-window-p))
>              (menu-bar-non-minibuffer-window-p))
>     :help "Create and edit a new file"))
> 
> (define-key-after menu-bar-file-menu [new-directory]
>   '(menu-item "New Directory..." menu-bar-create-directory
>     :enable (or (not (fboundp 'menu-bar-non-minibuffer-window-p))
>              (menu-bar-non-minibuffer-window-p))
>     :help "Create a directory")
>   'new-file)
> 
> I realize that :enable will cause that code to be run during
> redisplay.  Probably this is the culprit code, but I have never
> see that error before (and this code has been there a long time).
> 
> So maybe it's just a one-off thing.

Or maybe menu-bar-non-minibuffer-window-p should protect itself from
such calamities.  Martin, what do you think?