From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: removing the toolbar Date: Thu, 7 Oct 2004 10:15:22 -0700 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1097169380 22147 80.91.229.6 (7 Oct 2004 17:16:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Oct 2004 17:16:20 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 07 19:16:05 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CFbs4-0006UR-00 for ; Thu, 07 Oct 2004 19:16:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CFbyp-0005fB-6s for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Oct 2004 13:23:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CFbye-0005e4-7x for help-gnu-emacs@gnu.org; Thu, 07 Oct 2004 13:22:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CFbyc-0005dV-WE for help-gnu-emacs@gnu.org; Thu, 07 Oct 2004 13:22:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CFbyc-0005dS-TC for help-gnu-emacs@gnu.org; Thu, 07 Oct 2004 13:22:50 -0400 Original-Received: from [141.146.126.229] (helo=agminet02.oracle.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CFbrT-0008Ds-7o for help-gnu-emacs@gnu.org; Thu, 07 Oct 2004 13:15:27 -0400 Original-Received: from rgmgw3.us.oracle.com (rgmgw3.us.oracle.com [138.1.191.12]) by agminet02.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i97HFNio014198 for ; Thu, 7 Oct 2004 10:15:23 -0700 Original-Received: from rgmgw3.us.oracle.com (localhost [127.0.0.1]) by rgmgw3.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i97HFM0w006604 for ; Thu, 7 Oct 2004 11:15:22 -0600 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmgw3.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id i97HFMcr006591 for ; Thu, 7 Oct 2004 11:15:22 -0600 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Importance: Normal In-Reply-To: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:21126 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21126 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