help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: get current frame size?


From: Michael Heerdegen
Subject: Re: get current frame size?
Date: Mon, 12 Oct 2015 15:04:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Sivaram Neelakantan <nsivaram.net@gmail.com> writes:

> I end up working with different monitors and each time I end up doing
> a trail and error method to get the right frame size for Emacs that
> covers the width of the screen and 80% of the height.  Note that I
> don't want a fullscreen mode which I can invoke from the command
> line.  Is there a way to query the current frame to return the
> dimensions so that I can plug it in my .Emacs?
>
> Something like
>
> (if (window-system) (set-frame-size (selected-frame) 124 40))
>
> where the last 2 numbers seem to change for laptop screen

See (info "(elisp) Size Parameters").  But maybe consider doing it
dynamically:

 - Note that the fullscreen frame parameter can also be used to maximize
 a frame horizontally or vertically.

 - You can also calculate the frame parameters at run time using
 `display-pixel-width', `display-pixel-width'.  But I don't think Emacs
 knows the sizes of window borders and title bar, so the approach is
 somewhat limited.  At least can you use the above functions to test on
 which kind of screen you "are".

 - Drew Adam's "frame-cmds.el" has additional related stuff.


Michael.




reply via email to

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