From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Local tool-bar (for one frame), [toggle-frame-toolbar] Date: Sat, 16 Jul 2005 13:53:06 +0100 Message-ID: <17EC9745-940B-4E6B-AE5D-90B46681DBB5@gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1121518680 23499 80.91.229.2 (16 Jul 2005 12:58:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Jul 2005 12:58:00 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 16 14:57:55 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DtmEY-0004Uh-Gd for ged-emacs-devel@m.gmane.org; Sat, 16 Jul 2005 14:57:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DtmDt-0001eq-7I for ged-emacs-devel@m.gmane.org; Sat, 16 Jul 2005 08:56:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DtmDD-0001cD-Ik for emacs-devel@gnu.org; Sat, 16 Jul 2005 08:56:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DtmDA-0001az-4j for emacs-devel@gnu.org; Sat, 16 Jul 2005 08:56:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DtmD9-0001aL-VI for emacs-devel@gnu.org; Sat, 16 Jul 2005 08:56:08 -0400 Original-Received: from [64.233.184.201] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DtmIq-0004kE-Kq for emacs-devel@gnu.org; Sat, 16 Jul 2005 09:02:00 -0400 Original-Received: by wproxy.gmail.com with SMTP id 68so798293wri for ; Sat, 16 Jul 2005 05:53:13 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=aapV1BH0HSG2Vfr3lP4arrShqjS0A7yhSkYjVZFniXfTob+ZW5Q3EuxQn40/66sk77l2AKcnyzAAIMhjDjEcWQUy/kyVAeEtxqlXVN5rYkjWlSUjW2WcjKwQhUZ04hxfH+OaW+uBrxbe0Cfexls1a01a9NNkauhx461s6t0fV6U= Original-Received: by 10.54.31.62 with SMTP id e62mr1429210wre; Sat, 16 Jul 2005 05:53:13 -0700 (PDT) Original-Received: from ?10.0.0.60? ([82.26.163.96]) by mx.gmail.com with ESMTP id 24sm2206301wrl.2005.07.16.05.53.13; Sat, 16 Jul 2005 05:53:13 -0700 (PDT) Original-To: emacs-devel ' X-Mailer: Apple Mail (2.733) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41005 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41005 Would people be interested in a change that introduces a function `tool-bar-toggle' (in toolbar.el), allowing to switch a tool-bar on and off in a single frame? As shown below, it's not a minor mode (opposed to what Drew Adams suggested here: http://lists.gnu.org/archive/html/emacs-devel/ 2004-10/msg00248.html ) Also, I have implemented a little change that binds this to the tool- bar window button which exists on Mac OS X. The button click is bound to an event defined in keyboard.c (right now only in OS X), which gets mapped to [toggle-frame-toolbar] (in macterm.c). Then you do a simple (global-set-key [toggle-frame-toolbar] 'tool-bar-toggle) ;; local toolbars (defun tool-bar-enabled-p (&optional frame) "Evaluates to non-nil if the tool-bar is present in frame FRAME. If FRAME is nil, the function applies to the selected frame." (> (or (frame-parameter frame 'tool-bar-lines) 0) 0)) (defun tool-bar-toggle (&optional frame) "Switches the tool bar on and off in frame FRAME. If FRAME is nil, the change applies to the selected frame." (interactive) (modify-frame-parameters frame (list (cons 'tool-bar-lines (if (tool-bar-enabled-p) 0 1 )))))