unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: steve-humphreys@gmx.com
To: steve-humphreys@gmx.com
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Changing Frame Sizes
Date: Wed, 9 Dec 2020 00:08:16 +0100	[thread overview]
Message-ID: <trinity-a3a16b3d-54cc-4acc-bf3c-0d27337ca76e-1607468896856@3c-app-mailcom-bs11> (raw)
In-Reply-To: <trinity-e508e2a1-a916-4a9c-976f-f6a51e2a6869-1607444307958@3c-app-mailcom-bs08>


What is the difference between set-frame-parameter and set-frame-size?



> Sent: Tuesday, December 08, 2020 at 5:18 PM
> From: steve-humphreys@gmx.com
> To: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: Changing Frame Sizes
>
> 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)) ))
>
>
>
>



  reply	other threads:[~2020-12-08 23:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 16:18 Changing Frame Sizes steve-humphreys
2020-12-08 23:08 ` steve-humphreys [this message]
2020-12-08 23:31   ` steve-humphreys

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-a3a16b3d-54cc-4acc-bf3c-0d27337ca76e-1607468896856@3c-app-mailcom-bs11 \
    --to=steve-humphreys@gmx.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).