[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unuseful keybindings

From: Juri Linkov
Subject: Re: Unuseful keybindings
Date: Mon, 24 Dec 2012 19:10:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)

> Actually thinking more in terms of the command line arguments
> `--maximized' and `--fullscreen' suggests a better patch
> that for consistency defines exactly the same corresponding commands
> `toggle-frame-maximized' and `toggle-frame-fullscreen':

It is still too bad that when the frame is maximized, enabling and
disabling fullscreen doesn't restore its maximized state.

The problem is that we have only one frame parameter `fullscreen'
for both frame states `maximized' and `fullscreen'.

So for proper behavior like in other applications we need to remember
the previous `maximized' state and restore it afterwards
like `toggle-frame-fullscreen' does in the following patch:

=== modified file 'lisp/frame.el'
*** lisp/frame.el       2012-12-12 14:43:45 +0000
--- lisp/frame.el       2012-12-24 17:10:45 +0000
*************** (define-minor-mode blink-cursor-mode
*** 1655,1685 ****
  ;; Frame maximization
- (defcustom frame-maximization-style 'maximized
-   "The maximization style of \\[toggle-frame-maximized]."
-   :version "24.4"
-   :type '(choice
-           (const :tab "Respect window manager screen decorations." maximized)
-           (const :tab "Ignore window manager screen decorations." fullscreen))
-   :group 'frames)
  (defun toggle-frame-maximized ()
!   "Maximize/un-maximize Emacs frame according to `frame-maximization-style'.
! See also `cycle-frame-maximized'."
!    nil `((fullscreen . ,(if (frame-parameter nil 'fullscreen)
!                             nil frame-maximization-style)))))
! (defun cycle-frame-maximized ()
!   "Cycle Emacs frame between normal, maximized, and fullscreen.
  See also `toggle-frame-maximized'."
!    nil `((fullscreen . ,(cl-case (frame-parameter nil 'fullscreen)
!                                  ((nil) 'maximized)
!                                  ((maximized) 'fullscreen)
!                                  ((fullscreen) nil))))))
  ;;;; Key bindings
--- 1655,1690 ----
  ;; Frame maximization
  (defun toggle-frame-maximized ()
!   "Maximize the selected frame or un-maximize if it is already maximized.
! Respect window manager screen decorations.
! See also `toggle-frame-fullscreen'."
!    nil
!    `((fullscreen
!       . ,(cond
!         ((eq (frame-parameter nil 'fullscreen) 'fullscreen) 'maximized)
!         ((frame-parameter nil 'fullscreen) nil)
!         (t 'maximized))))))
! (defun toggle-frame-fullscreen ()
!   "Maximize selected frame to fullscreen or restore if it is fullscreen.
! Ignore window manager screen decorations.
  See also `toggle-frame-maximized'."
!    nil
!    `((fullscreen
!       . ,(if (eq (frame-parameter nil 'fullscreen) 'fullscreen)
!            (if (eq (frame-parameter nil 'maximized) 'maximized)
!                'maximized)
!          'fullscreen))
!      (maximized
!       . ,(if (eq (frame-parameter nil 'fullscreen) 'fullscreen)
!            nil
!          (frame-parameter nil 'fullscreen))))))
  ;;;; Key bindings

reply via email to

[Prev in Thread] Current Thread [Next in Thread]