When I maximize the Emacs frame, it uses the full width of the screen, no background showing. But if I e.g. snap-to-edge (in XFCE), it shows a little "margin" of background outside the frame. And if I drag to resize, it always over- or undershoots the edge – it looks like it wants to always resize by whole lines/characters. Is there a way to have a 50% size Emacs frame that aligns with the edge of the screen?
(I'm using 20170203:93058-ce88155-emacs-25.1~ubuntu16.04.1)
Mousepad can take exactly 50% width and 100%height, with height from the top of the screen down to the panel:
Emacs seems to overshoot/undershoot:
When I "snap" Emacs to the edges with XFCE, it fits the width on my laptop, but not on my external monitor. It never matches the full height.
display-pixel-width
anddisplay-pixel-height
,set-frame-height
,set-frame-width
,set-frame-size
,set-frame-position
-- including the optional PIXELWISE argument for some of the functions : gnu.org/software/emacs/manual/html_node/elisp/… And, of course, the division/
function -- i.e., just like a divorce (divide by two). If you want to set this at the outset, have a look atdefault-frame-alist
,initial-frame-alist
, and also certain paramaters that can be passed to themake-frame
function. Emacs 25 handles this better.Mousepad
) -- and then subtract that pixel width from the Emacsdisplay-pixel-width
in the answer below to come up with the exact Emacs frame size -- that assumes theMousepad
is flush right. Or you will need to get the left pixel bound ofMousepad
and calculate accordingly. Emacs does not have any function that I am aware of that could search the screen for all other application windows that are present and attempt to adjust its size based on something likeMousepad
.set-frame-width
to come up with your perfect setting.frame-resize-pixelwise
, which solved the problem in general too :-)