Subject: Re: 23.0.60; tool-bar is shown with tool-bar-mode off

From: Chong Yidong <[email-masked]>
Date: Thu, 01 Jan 2009 02:03:21 -0500

"Drew Adams" <[email-masked]> writes:

> Huh? Why is that the right thing?

Because your function `foo' tells Emacs to add a tool-bar to new frames.
Here is a much, much simpler version of your "bug":

 In foo.el;
  (tool-bar-mode -1)
  (defun foo ()
    (interactive)
    (setq default-frame-alist
          (append (list (cons 'tool-bar-lines 1))
                  default-frame-alist)))

 emacs -Q -l "foo.el" -f "foo"

When foo.el is loaded, that turns off tool-bar-mode (internally, this
works by modifying default-frame-alist and changing the frame parameter
`tool-bar-lines' to 0).

Next, the function `foo' is run.  That modifies default-frame-alist by
adding (tool-bar-lines . 1).  So, all new frames get a tool-bar.