I am trying to setup my init files, and want a special set of dimensions for my main Emacs window. If I place my window wherever I want it, is there a way of querying Emacs as to the main window dimensions? I.e., is there a way of querying the value of the top
, left
, width
, and height
values of the main window as it is currently placed?
-
1In Emacs, we use the word "frame" to mean the whole kitten kaboodle; whereas, "window" is within the "frame" and there can be many "windows". Please edit your question (title and body) accordingly. In addition, please specify your operating system -- other solutions may exist, e.g., an applescript on OSX to get frame coordinates, etc.– lawlistJan 23, 2015 at 15:30
-
How about this google search for "emacs window dimensions"? Among the first hits are manual pages for window sizes and frame size and position.– Dan ♦Jan 23, 2015 at 15:42
-
@Dan -- I don't believe any of those functions return frame coordinates on the OS desktop in pixels.– lawlistJan 23, 2015 at 15:51
1 Answer
There's (window-width)
and (window-pixel-width)
(and the equivalent height functions) for getting the width in characters and pixels respectively.
There's also (window-pixel-top)
and (window-pixel-left)
.
I'm not really sure if these are what you're looking for.
I used helm-apropos
to find these functions. There's also a built-in command to search functions: M-x apropos RET window left RET
.