From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Unuseful keybindings Date: Sun, 23 Dec 2012 11:31:02 +0200 Organization: JURTA Message-ID: <87d2y1glnt.fsf@mail.jurta.org> References: <87sj73qzvl.fsf@gmail.com> <87623zquvw.fsf@gmail.com> <87ip7zdud3.fsf@gmail.com> <87ehiiu5x7.fsf@gnu.org> <87a9t6a435.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1356255589 24297 80.91.229.3 (23 Dec 2012 09:39:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Dec 2012 09:39:49 +0000 (UTC) Cc: Thierry Volpiatto , emacs-devel@gnu.org, Andreas Schwab , Mathias Dahl To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 23 10:40:03 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tmi2E-0005Ft-Jp for ged-emacs-devel@m.gmane.org; Sun, 23 Dec 2012 10:39:54 +0100 Original-Received: from localhost ([::1]:59067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tmi20-0000U1-KA for ged-emacs-devel@m.gmane.org; Sun, 23 Dec 2012 04:39:40 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tmi1t-0000SH-UE for emacs-devel@gnu.org; Sun, 23 Dec 2012 04:39:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tmi1p-0008VX-BH for emacs-devel@gnu.org; Sun, 23 Dec 2012 04:39:33 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:35994 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tmi1m-0008VI-QI; Sun, 23 Dec 2012 04:39:26 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id EFCB1451CE4E; Sun, 23 Dec 2012 01:39:24 -0800 (PST) In-Reply-To: <87a9t6a435.fsf@mail.jurta.org> (Juri Linkov's message of "Sat, 22 Dec 2012 10:23:38 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 69.163.218.105 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155800 Archived-At: >> But: why doesn't toggle a true full screen mode, at least on >> platforms which support that? That would be more useful, since ordinary >> maximization can be done with window decorations anyway. > > I wondered about this too. IMHO, `frame-maximization-style' should be > `fullscreen' by default, so `F11' will do fullscreen by default. > > Also I see no reason having a separate `S-F11' (`cycle-frame-maximized'). > I believe it would be enough to add a prefix arg to `toggle-frame-maximized', > so `C-u F11' will do non-default complementary action from `frame-maximization-style' > (i.e. `maximized' after changing its default to `fullscreen'). This can be improved with the following patch: === modified file 'lisp/frame.el' --- lisp/frame.el 2012-12-12 14:43:45 +0000 +++ lisp/frame.el 2012-12-23 09:30:39 +0000 @@ -1655,7 +1655,7 @@ (define-minor-mode blink-cursor-mode ;; Frame maximization -(defcustom frame-maximization-style 'maximized +(defcustom frame-maximization-style 'fullscreen "The maximization style of \\[toggle-frame-maximized]." :version "24.4" :type '(choice @@ -1663,13 +1663,18 @@ (defcustom frame-maximization-style 'max (const :tab "Ignore window manager screen decorations." fullscreen)) :group 'frames) -(defun toggle-frame-maximized () +(defun toggle-frame-maximized (&optional arg) "Maximize/un-maximize Emacs frame according to `frame-maximization-style'. -See also `cycle-frame-maximized'." - (interactive) +With prefix ARG toggle using non-default value of `frame-maximization-style', +i.e. when the default is `fullscreen', use `maximized', otherwise use +`fullscreen'. See also `cycle-frame-maximized'." + (interactive "P") (modify-frame-parameters - nil `((fullscreen . ,(if (frame-parameter nil 'fullscreen) - nil frame-maximization-style))))) + nil `((fullscreen . ,(cond + ((frame-parameter nil 'fullscreen) nil) + (arg (if (eq frame-maximization-style 'fullscreen) + 'maximized 'fullscreen)) + (t frame-maximization-style)))))) (defun cycle-frame-maximized () "Cycle Emacs frame between normal, maximized, and fullscreen.