all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Changing Frame Sizes
@ 2020-12-08 16:18 steve-humphreys
  2020-12-08 23:08 ` steve-humphreys
  0 siblings, 1 reply; 3+ messages in thread
From: steve-humphreys @ 2020-12-08 16:18 UTC (permalink / raw)
  To: Help Gnu Emacs

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)) ))





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-08 23:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-08 16:18 Changing Frame Sizes steve-humphreys
2020-12-08 23:08 ` steve-humphreys
2020-12-08 23:31   ` steve-humphreys

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.