From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: Toggle fullscreen with one key Date: 18 Mar 2005 16:30:32 -0800 Organization: http://groups.google.com Message-ID: <1111192232.441586.253180@f14g2000cwb.googlegroups.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1111192485 18908 80.91.229.2 (19 Mar 2005 00:34:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 19 Mar 2005 00:34:45 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 19 01:34:44 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DCRv7-000428-PK for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Mar 2005 01:34:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DCSBi-00023j-Bf for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Mar 2005 19:51:34 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: 198.74.20.74 Original-X-Trace: posting.google.com 1111192236 7409 127.0.0.1 (19 Mar 2005 00:30:36 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 19 Mar 2005 00:30:36 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=198.74.20.74; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:129374 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:24929 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24929 This seems to work pretty well for me. If you use the restore/maximize buttons or double click the title bar (etc) my-frame-state could get out of sync but it re-syncs every time my-frame-maximize or my-frame-restore are called. (make-variable-frame-local 'my-frame-state) > > (defun my-frame-maximize () "Maximize Emacs window in win32" > (interactive) (modify-frame-parameters nil '((my-frame-state . t))) > (w32-send-sys-command ?\xf030)) > > (defun my-frame-restore () "Restore Emacs window in win32" > (interactive) (modify-frame-parameters nil '((my-frame-state . nil))) > (w32-send-sys-command ?\xF120)) > (defun my-frame-toggle () "Maximize/Restore Emacs frame based on `my-frame-state'" (interactive) (if my-frame-state (my-frame-restore) (my-frame-maximize))) > --- keys > (global-set-key [f2] 'my-frame-toggle) >