[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changing Frame Sizes
From: |
steve-humphreys |
Subject: |
Changing Frame Sizes |
Date: |
Tue, 8 Dec 2020 17:18:27 +0100 |
Have the following code to change the frame size. It works fairly well
when using numbers. But have got into problems when trying to use 'fullwidth,
'fullheight, 'fullboth.
Another problem that I am encountering is this. When there exist multiple
buffers
in the frame, the window margins are only made on the current buffer. I would
like
that the margins are applied to all windows in the frame when calling
put-margins.
(defun put-margins (&optional width)
(interactive)
(unless width (setq width 3))
(set-window-margins nil width width) )
(defun fullframe-enable ()
(interactive)
(set-frame-parameter nil 'fullscreen 'fullboth)
(tool-bar-mode -1)
(menu-bar-mode -1))
(defun fullframe-disable ()
(interactive)
(set-frame-parameter nil 'fullscreen 'fullheight)
(tool-bar-mode t)
(menu-bar-mode t))
(defvar frame-size-state 1)
(defun frame-size-cycle ()
(interactive)
(pcase frame-size-state
(1 (message "Full Frame")
(if (one-window-p)
(put-margins) ; single window
(put-margins 2)) ; multiple windows
(fullframe-enable)
(setq frame-size-state 2))
(2 (message "Frame: Size 90x34")
(put-margins 0)
(fullframe-disable)
(set-frame-size (selected-frame) 'fullboth)
(setq frame-size-state 3))
(3 (message "Frame: Size 75x34")
(set-frame-size (selected-frame) 75 'fullheight)
(setq frame-size-state 4))
(4 (message "Frame: Size 58x21")
(set-frame-size (selected-frame) 58 'fullheight)
(setq frame-size-state 1)) ))
- Changing Frame Sizes,
steve-humphreys <=