From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#1077: 23.0.60; x-create-frame: (wrong-type-argument number-or-marker-p nil) Date: Mon, 29 Nov 2010 20:58:22 +0200 Message-ID: <8362vg9ctt.fsf@gnu.org> References: <003e01c9257c$a385d800$0200a8c0@us.oracle.com> <009701c9263f$9cce7120$0200a8c0@us.oracle.com> <000001c94cc1$e10e9c40$0200a8c0@us.oracle.com> <8F1F8998D60341099C4204B7BDD8AD4F@us.oracle.com> <96BC00F728B94AC18A15EA95B66C5248@us.oracle.com> <83zksv5g7j.fsf@gnu.org> <0A475933984F4CDA855D91C8B7639E3B@us.oracle.com> <83fwum5xzk.fsf@gnu.org> <9F24875655894485A414CD785D95725B@us.oracle.com> <83ipzh9qze.fsf@gnu.org> <4CF386C9.5070909@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1291058122 12596 80.91.229.12 (29 Nov 2010 19:15:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Nov 2010 19:15:22 +0000 (UTC) Cc: 1077@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 29 20:15:17 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PN9Bv-0002I1-M1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Nov 2010 20:15:14 +0100 Original-Received: from localhost ([127.0.0.1]:41716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PN9Bu-0006Y9-UX for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Nov 2010 14:15:10 -0500 Original-Received: from [140.186.70.92] (port=44896 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PN9Bn-0006WC-4j for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2010 14:15:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PN9Bi-00005P-8f for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2010 14:14:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PN9Bi-00005G-5y for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2010 14:14:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PN8oY-000359-3V; Mon, 29 Nov 2010 13:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Nov 2010 18:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1077 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 1077-submit@debbugs.gnu.org id=B1077.129105664211821 (code B ref 1077); Mon, 29 Nov 2010 18:51:02 +0000 Original-Received: (at 1077) by debbugs.gnu.org; 29 Nov 2010 18:50:42 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PN8oD-00034a-VM for submit@debbugs.gnu.org; Mon, 29 Nov 2010 13:50:42 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PN8oA-00034N-AV for 1077@debbugs.gnu.org; Mon, 29 Nov 2010 13:50:39 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LCN00900TUY4X00@a-mtaout20.012.net.il> for 1077@debbugs.gnu.org; Mon, 29 Nov 2010 20:56:11 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.63.39]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LCN008ZWTXLPC20@a-mtaout20.012.net.il>; Mon, 29 Nov 2010 20:56:10 +0200 (IST) In-reply-to: <4CF386C9.5070909@gmx.at> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 29 Nov 2010 13:51:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:42007 Archived-At: > Date: Mon, 29 Nov 2010 11:56:09 +0100 > From: martin rudalics > CC: Drew Adams , 1077@debbugs.gnu.org > > > And it's a different frame from what we saw in Fx_create_frame, observe: > > [...] > > But down below, in frame #3, where `(frame-parameter nil 'menu-bar-lines)' > > is evaluated, it _will_ use selected_frame, right? So what's going on > > here? Any ideas are welcome. > > Do you mean the selected frame changes in between? No. We are in the middle of creating a new frame, remember? The frame that we are creating is not constructed yet, so it cannot yet become the selected_frame. It will become that later. The currently selected frame is still the minibuffer frame: (gdb) p selected_frame $9 = 49998341 (gdb) xframe $10 = (struct frame *) 0x2faea00 "Emacs Minibuffer" The problem is that the offending menu item accesses the currently selected frame's parameters: (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)))) ^^^ The frame we are creating is not yet ready, and is certainly not yet the selected frame! Isn't that a bug? shouldn't we use menu-updating-frame instead of nil, in the above call to frame-parameter? > Anyway, I think there are at least three other bugs: > > (1) Evaluating Lisp code in `define-key' can crash Emacs. Sorry, I don't follow: are you saying that we must not evaluate Lisp code inside `define-key', or are you saying something else? > > (2) The menu-bar define-key operations to toggle `menu-bar-mode' and > `tool-bar-mode' do not take into account that the values of the > respective frame parameter can be nil. As you see above, this happens for the minibuffer frame. Can you explain how we get `(menu-bar-lines)' instead of having the usual `(menu-bar-lines . 1)' or `(menu-bar-lines . 0)' in the parameters alist of the minibuffer frame? Is that normal, or is that another bug? > (3) Frame parameters of `menu-bar-lines' and actual appearance of a > menubar are inconsistent for minibuffer-only frames.