From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#1754: 23.0.60; tool-bar is shown with tool-bar-mode off Date: Thu, 1 Jan 2009 13:28:17 -0800 Message-ID: <008801c96c57$dcbd5540$0200a8c0@us.oracle.com> References: <005301c96b95$547ae890$c2b22382@us.oracle.com> <495CE033.70808@gmx.at> Reply-To: Drew Adams , 1754@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1230846222 24568 80.91.229.12 (1 Jan 2009 21:43:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Jan 2009 21:43:42 +0000 (UTC) Cc: 1754@emacsbugs.donarmstrong.com To: "'martin rudalics'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 01 22:44:50 2009 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.50) id 1LIVLV-0007x2-LR for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Jan 2009 22:44:50 +0100 Original-Received: from localhost ([127.0.0.1]:59064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LIVKG-00010d-IJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Jan 2009 16:43:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LIVKB-00010E-6N for bug-gnu-emacs@gnu.org; Thu, 01 Jan 2009 16:43:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LIVKA-0000zn-KG for bug-gnu-emacs@gnu.org; Thu, 01 Jan 2009 16:43:26 -0500 Original-Received: from [199.232.76.173] (port=45631 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LIVKA-0000zh-57 for bug-gnu-emacs@gnu.org; Thu, 01 Jan 2009 16:43:26 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:58101) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LIVK9-0007GV-Ec for bug-gnu-emacs@gnu.org; Thu, 01 Jan 2009 16:43:25 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n01LhMY4009078; Thu, 1 Jan 2009 13:43:23 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n01LZ54t006914; Thu, 1 Jan 2009 13:35:05 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 01 Jan 2009 21:35:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1754 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1754-submit@emacsbugs.donarmstrong.com id=B1754.12308453085540 (code B ref 1754); Thu, 01 Jan 2009 21:35:04 +0000 Original-Received: (at 1754) by emacsbugs.donarmstrong.com; 1 Jan 2009 21:28:28 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from rgminet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n01LSPw3005528 for <1754@emacsbugs.donarmstrong.com>; Thu, 1 Jan 2009 13:28:26 -0800 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n01LSuQG023700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Jan 2009 21:28:58 GMT Original-Received: from acsmt700.oracle.com (acsmt700.oracle.com [141.146.40.70]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n01LLQ7a008727; Thu, 1 Jan 2009 21:21:27 GMT Original-Received: from dradamslap1 (/24.5.134.5) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Jan 2009 21:28:14 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <495CE033.70808@gmx.at> Thread-Index: AclsJX37ag8MOW/aSIikTxmNaRc8TgALdCbg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt700.oracle.com [141.146.40.70] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.495D3570.0147:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 01 Jan 2009 16:43:26 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:23665 Archived-At: > > (tool-bar-mode -1) > [...] > > (setq default-frame-alist > > (append (list (cons 'tool-bar-lines 1)) > > default-frame-alist)) > > Inherently, you're painting yourself into a corner by simultaneously > demanding and rejecting toolbars. Moreover, that last assignment gets > you a second entry for `tool-bar-lines' in > `default-frame-alist' (and we have received _lots_ of mails > from you complaining about such duplicate entries before). No, as a result of those "_lots_ of mails" I sent, that bug was finally fixed. No duplicate entries are created by Emacs since 2008-12-31. However, you are correct that the code above creates a second entry for `tool-bar-lines'. That should not be a problem - the first entry is used (it is an alist, after all). That is, there is no corner. The latest change to the parameter `tool-bar-lines' should _always_ prevail - regardless of whether you use `modify-frame-parameters' or (setq default-frame-alist...) or you call `tool-bar-mode'. The problem is, I'm thinking now, that the entry (tool-bar-lines . 1) in `pop-up-frames-alist' is being used for the creation of new frames when `pop-up-frames' is non-nil. If that is happening, it is incorrect behavior, on two counts: 1. `tool-bar-mode' should be modal and affect all existing and subsequent frames, regardless of their default alist (`special-display-frame-alist', `pop-up-frame-alist', or `default-frame-alist'). 2. `pop-up-frame-alist' should not be used for creating normal new frames. The "pop-up" in each of the names `pop-up-frames' and `pop-up-frames-alist' means very different things. `pop-up-frames-alist' is not about creating normal new frames - `default-frame-alist' should be used for that. And `pop-up-frames' simply changes things like `C-x 4 f' to act like `C-x 5 f' - it has nothing to do with popup frames. `pop-up-frames-alist' is about special, "popup" frames (which is why it is a separate alist, like `special-display-frame-alist'): "Alist of frame parameters used when creating pop-up frames. Pop-up frames are used for completions, help, and the like. This variable can be set in your init file, like this: (setq pop-up-frame-alist '((width . 80) (height . 20))) These supersede the values given in `default-frame-alist', for pop-up frames." > However, you do _not_ set `initial-frame-alist' simultaneously, > so you won't get a toolbar for the first frame which is the > correct behavior since you have toggled tool-bar-mode off > before and only that counts for the initial frame (unless you > explicitly override it). Since `default-frame-alist' contains > a tool-bar-lines entry you will get a toolbar for future frames > which is correct as well. Sorry, all of that text is irrelevant to my bug report. I am not concerned about the initial frame. > That said, the behavior of Emacs _is_ wrong because it should not say > that `tool-bar-mode' is on when there are no toolbars. More importantly, if you turn the mode off, new frames should also not have tool bars. That is the point here. > The reason is that `tool-bar-mode' does > > (if tool-bar-mode > (progn > (dolist (frame (frame-list)) > (if (display-graphic-p frame) > (set-frame-parameter frame 'tool-bar-lines 1))) > (if (= 1 (length (default-value 'tool-bar-map))) ; not yet setup > (tool-bar-setup))) > (modify-all-frames-parameters (list (cons 'tool-bar-lines 0))))) > > so you can easily see that for turning `tool-bar-mode' off, > default and initial frame parameters are set. For turning it on, only the > parameters of the existing frames are set and _no_ default or initial > parameters. That might be at least partly responsible for the bug. Again, the current bugged behavior: 1. is a regression - the behavior was correct in Emacs 22 2. does not correspond to the behavior of `menu-bar-mode', which is correct in Emacs 23, like 22 > Since the `display-graphic-p' test is not useful > anyway, I propose the attached patch. I think the logic of your patch is needed, but it is not sufficient. I tried your patch (by just redefining tool-bar-mode after running my test case), but it unfortunately does not seem to fix the problem. I suspect the remaining problem is as I indicated above: `pop-up-frame-alist' is being used when it shouldn't be used - to open normal frames (not popup frames). The Emacs 22.3 code works fine in all regards.