From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: Toggle fullscreen with one key Date: Fri, 18 Mar 2005 13:11:49 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1111148683 3986 80.91.229.2 (18 Mar 2005 12:24:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2005 12:24:43 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 18 13:24:43 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DCGWu-0005vj-Mh for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Mar 2005 13:24:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DCGnO-0000S2-Fg for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Mar 2005 07:41:42 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-X-Trace: individual.net zdxm4vMBdwh1d/HfuRXArQLJf8B2bWobQGTFZGb/Fgzt1Gx5ND User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:ChjzxZ3tcV9CcRZp8fvFNKcox3Q= Original-Xref: shelby.stanford.edu gnu.emacs.help:129363 Original-To: help-gnu-emacs@gnu.org 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: news.gmane.org gmane.emacs.help:24918 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24918 Johan Josefsson writes: > I am currently using two keys (f2 and C-f2) and two functions for > maximizing and restoring the frame in win32: > [...] > It works as intended, but I wonder, is there any simple way to > replace these two keys with a function that use only one key (f2) to > toggle between these two states? > This is a bit ugly (one should really check the "real" state of the frame), but works: (defvar my-frame-toggle-state nil "Just a dummy variable too keep track of things") (defun my-frame-toggle () (interactive) (if my-frame-toggle-state (my-frame-restore) (my-frame-maximize)) (setq my-frame-toggle-state (not my-frame-toggle-state))) (defun my-frame-maximize () "Maximize Emacs window in win32" (interactive) (w32-send-sys-command ?\xf030)) (defun my-frame-restore () "Restore Emacs window in win32" (interactive) (w32-send-sys-command ?\xF120)) /Mathias