unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* removing the toolbar
@ 2004-10-07 13:12 Uwe Mayer
  2004-10-07 13:47 ` Miguel Frasson
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Uwe Mayer @ 2004-10-07 13:12 UTC (permalink / raw)


Hi,

I added the line
'(tool-bar-mode nil nil (tool-bar))

to my .emacs file (- who needs the toolbar? ;)). A line in my .Xdefaults
causes emacs to start with geometry 83x71, but when the first emacs
instance initialises it starts up with the specified size but then removes
the toolbar and gets shorter by the space the toolbar took up previously.
If I open a file in another windows C-x 5 f it does not need to remove the
toolbar and the window is displayed in the proper size.

Does anyone know how to prevent the behaviour of the first emacs instance so
it starts up with the specified size?

Thanks
Ciao
Uwe 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: removing the toolbar
  2004-10-07 13:12 removing the toolbar Uwe Mayer
@ 2004-10-07 13:47 ` Miguel Frasson
  2004-10-07 14:00 ` Reiner Steib
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Miguel Frasson @ 2004-10-07 13:47 UTC (permalink / raw)


Uwe Mayer <merkosh@hadiko.de> writes:

> Hi,
> 
> I added the line
> '(tool-bar-mode nil nil (tool-bar))
> 
> to my .emacs file (- who needs the toolbar? ;)). A line in my .Xdefaults
> causes emacs to start with geometry 83x71, but when the first emacs
> instance initialises it starts up with the specified size but then removes
> the toolbar and gets shorter by the space the toolbar took up previously.
> If I open a file in another windows C-x 5 f it does not need to remove the
> toolbar and the window is displayed in the proper size.
> 
> Does anyone know how to prevent the behaviour of the first emacs instance so
> it starts up with the specified size?


Did you try to just customize the variable tool-bar-mode?  Maybe (I am not
sure) the customization is loaded before the frame actually display any
toolbar.

By adding such line 
  '(tool-bar-mode nil nil (tool-bar))
what do you get?  It is a quoted expression... or do you mean that you
changed by hand a customization?

[]

Miguel.

-- 
Miguel Vinicius Santini Frasson
http://www.math.leidenuniv.nl/~frasson

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: removing the toolbar
  2004-10-07 13:12 removing the toolbar Uwe Mayer
  2004-10-07 13:47 ` Miguel Frasson
@ 2004-10-07 14:00 ` Reiner Steib
  2004-10-07 14:38 ` FCC
  2004-10-07 16:02 ` Stefan Monnier
  3 siblings, 0 replies; 7+ messages in thread
From: Reiner Steib @ 2004-10-07 14:00 UTC (permalink / raw)


On Thu, Oct 07 2004, Uwe Mayer wrote:

> Does anyone know how to prevent the behaviour of the first emacs
> instance so it starts up with the specified size?

,----[ (info "(emacs)Resources X") ]
| `toolBar' (class `ToolBar')
|      Number of lines to reserve for the tool bar.  A zero value
|      suppresses the tool bar.  If the value is non-zero and
|      `auto-resize-tool-bars' is non-`nil', the tool bar's size will be
|      changed automatically so that all tool bar items are visible.
`----

$ xrdb -q|grep -ie emacs.*tool
Emacs.toolBar:  0

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: removing the toolbar
  2004-10-07 13:12 removing the toolbar Uwe Mayer
  2004-10-07 13:47 ` Miguel Frasson
  2004-10-07 14:00 ` Reiner Steib
@ 2004-10-07 14:38 ` FCC
  2004-10-07 15:50   ` Peter Lee
  2004-10-07 17:15   ` Drew Adams
  2004-10-07 16:02 ` Stefan Monnier
  3 siblings, 2 replies; 7+ messages in thread
From: FCC @ 2004-10-07 14:38 UTC (permalink / raw)


On Windows, with Emacs 21.3.50.1 of 2004-07-09 and a line in _emacs like
(tool-bar-mode 0)
the same thing happens.
I found that, toolbar eats up 3 lines, so I just increased my old line
count by 3 by
(set-frame-height (selected-frame) 66) ;; This used to be 63 with 21.3

Regards,

Uwe Mayer articulated on 10/7/2004 3:12 PM:
> Hi,
> 
> I added the line
> '(tool-bar-mode nil nil (tool-bar))
> 
> to my .emacs file (- who needs the toolbar? ;)). A line in my .Xdefaults
> causes emacs to start with geometry 83x71, but when the first emacs
> instance initialises it starts up with the specified size but then removes
> the toolbar and gets shorter by the space the toolbar took up previously.
> If I open a file in another windows C-x 5 f it does not need to remove the
> toolbar and the window is displayed in the proper size.
> 
> Does anyone know how to prevent the behaviour of the first emacs instance so
> it starts up with the specified size?
> 
> Thanks
> Ciao
> Uwe 


-- 
FCC.
===
Resisting temptation is easier when you think you'll probably get
another chance later on.
-Unknown

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: removing the toolbar
  2004-10-07 14:38 ` FCC
@ 2004-10-07 15:50   ` Peter Lee
  2004-10-07 17:15   ` Drew Adams
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Lee @ 2004-10-07 15:50 UTC (permalink / raw)


>>>> FCC  writes:

    >> On Windows, with Emacs 21.3.50.1 of 2004-07-09 and a line in
    >> _emacs like (tool-bar-mode 0) the same thing happens.  I found
    >> that, toolbar eats up 3 lines, so I just increased my old line
    >> count by 3 by (set-frame-height (selected-frame) 66) ;; This
    >> used to be 63 with 21.3

I had same problem... what I did was start emacs with the -Q option.

,----
| ** New command line option -Q.
| 
| This is like using -q --no-site-file, but in addition it also disables
| the menu-bar, the tool-bar, the scroll-bars, tool tips, the blinking
| cursor, and the fancy startup screen.
`----

as well as a --load c:/path/.emacs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: removing the toolbar
  2004-10-07 13:12 removing the toolbar Uwe Mayer
                   ` (2 preceding siblings ...)
  2004-10-07 14:38 ` FCC
@ 2004-10-07 16:02 ` Stefan Monnier
  3 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2004-10-07 16:02 UTC (permalink / raw)


> instance initialises it starts up with the specified size but then removes
> the toolbar and gets shorter by the space the toolbar took up previously.

When you start Emacs, it begins by creating a frame, then reads your .emacs.
So when it creates the frame, it hasn't seen yet that you want the toolbar
to be turned off.  After the .emacs is read, the frame is reconfigured to
correspond to the new settings.

If you think this behavior should be changed, please send a feature request
to gnu.emacs.bug.

E.g. I've changed my Emacs to create the initial frame *after* reading the
.emacs file so as to avoid/reduce those problems (but then all the "loading"
messages from my .emacs are sent to stderr).

As someone mentioned, you can fix your particular problem by using
Xresources because these are read before creating the initial frame.


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: removing the toolbar
  2004-10-07 14:38 ` FCC
  2004-10-07 15:50   ` Peter Lee
@ 2004-10-07 17:15   ` Drew Adams
  1 sibling, 0 replies; 7+ messages in thread
From: Drew Adams @ 2004-10-07 17:15 UTC (permalink / raw)


I realize that your question was about removing the toolbar from the initial
frame. Stefan answered that. I think you can also try just putting
(tool-bars) into `initial-frame-alist' in your .emacs.

Anyway, this message is to let people know that you can get rid of the
tool-bar but still have it available by a click on the menu-bar. This is a
message I posted yesterday to emacs-devel and gnu-emacs-sources:



-----Original Message-----
From: emacs-devel-bounces+drew.adams=oracle.com@gnu.org
[mailto:emacs-devel-bounces+drew.adams=oracle.com@gnu.org]On Behalf Of
Drew Adams
Sent: Thursday, October 07, 2004 12:52 AM
To: gnu-emacs-sources@gnu.org; Emacs-Devel
Subject: pop-up tool-bar


This code adds a minor mode, `tool-bar-here-mode', which is the same as
`tool-bar-mode', except that it affects only the selected frame.

It also adds a "button" named "Tool Bar" to the far right of the menu-bar
whenever the tool-bar is not visible (both `tool-bar-here-mode' and
`tool-bar-mode' are turned off). You can click the button to pop up the
tool-bar on the selected frame for the execution of a single command
(typically a tool-bar button click). The Tool Bar button is absent whenever
the tool-bar is visible, and vice versa.

The idea is to _conserve frame real estate_ but still have quick access to
the tool-bar: No reason to have a tool-bar on each frame. No reason to have
a tool-bar visible all the time; just pop it up when you need it.

Any interest in adding something like this to Emacs (file tool-bar.el)? It's
not intended to replace `tool-bar-mode'; it's just an alternative for people
who might want to use the tool-bar sometimes but don't want to sacrifice
real estate from every frame all the time.

 - Drew

---------------8<-----------------------------------

(define-key global-map [menu-bar temp-tool-bar]
  '(menu-item "Tool Bar" show-tool-bar-for-one-command
              :visible (and (not tool-bar-mode) (not tool-bar-here-mode))
              :enable (and (not tool-bar-mode) (not tool-bar-here-mode))
              :help "Use tool bar for one command"))

(setq menu-bar-final-items (append menu-bar-final-items (list
'temp-tool-bar)))


(define-minor-mode tool-bar-here-mode
  "Toggle use of the tool bar on this frame only.
With numeric ARG, display the tool bar if and only if ARG is positive.

See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for
conveniently adding tool bar items."
  :init-value nil :global t :group 'mouse :group 'frames
  (and (display-images-p)
       (let ((lines (if tool-bar-here-mode 1 0)))
	 ;; Alter existing frame...
	 (modify-frame-parameters (selected-frame) (list (cons 'tool-bar-lines
lines))))
       (if (and tool-bar-here-mode
		(display-graphic-p)
		(= 1 (length (default-value 'tool-bar-map)))) ; not yet set up
	   (tool-bar-setup))))

(defun show-tool-bar-for-one-command ()
  "Pop up the tool bar so you can click a button.
The tool bar stays visible until one command is executed
\(whether or not it was initiated by clicking a button)."
  (interactive)
  (unwind-protect
      (let (evnt)
        (tool-bar-here-mode 99)         ; Show tool-bar
        (setq evnt (read-event))
        (push evnt unread-command-events))
    (tool-bar-here-mode -99)))          ; Hide tool-bar

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-10-07 17:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-07 13:12 removing the toolbar Uwe Mayer
2004-10-07 13:47 ` Miguel Frasson
2004-10-07 14:00 ` Reiner Steib
2004-10-07 14:38 ` FCC
2004-10-07 15:50   ` Peter Lee
2004-10-07 17:15   ` Drew Adams
2004-10-07 16:02 ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).