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

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

Problems positioning and sizing Emacs frames


From: Dr Rainer Woitok
Subject: Problems positioning and sizing Emacs frames
Date: Mon, 19 Dec 2022 19:29:50 +0100

Greetings,

I fail to position my Emacs frames  where I want them.   The first frame
should be opened with its right edge flush with the right screen edge of
the monitor, as in

   $ emacs --geometry 80x40-0+6 . &

According to  "C-h v initial-frame-alist"  I should set this variable so
it matches the Emacs specific entries  in ".Xresources" plus the "--geo-
metry" specification  from the  command line,  while variable  "default-
frame-alist" should contain the relevant settings  for frames opened la-
ter via "C-x 5 C-f".

Here is  how I set variables  "default-frame-alist"  and "initial_frame-
alist" in file "init.el":

(let* ((g (split-string                         (getenv "_EMACS_SIZE_") "x"))
       (l (*    3             (string-to-number (getenv "_WINDOW_OFFSET_"))))
       (p (list (cons 'font-parameter           (getenv "_EMACS_FONT_"))
                (cons 'top    (string-to-number (getenv "_WINDOW_TOP_")))
                (cons 'height (string-to-number (cadr g)))
                (cons 'width  (string-to-number (car  g)))

                '(horizontal-scroll-bars .   nil)
                '(left-fringe            .     0)
                '(right-fringe           .   nil)
                '(menu-bar-lines         .     0)
                '(tab-bar-lines          .     0)
                '(tool-bar-lines         .     0)
                '(vertical-scroll-bars   . right)
      ))   )
      (setq default-frame-alist (cons (cons 'left    l) p)
            initial-frame-alist (cons (list 'left '- 0) p)
)     )

These are the definitions of the environment variables used above:

$ env | grep -E '^_(EMACS|WINDOW)_'
_EMACS_FONT_=-bitstream-bitstream vera sans mono-medium-r-*--21-*-*-*-m-*-*-*
_EMACS_SIZE_=80x40
_WINDOW_OFFSET_=50
_WINDOW_TOP_=6
$

And here are the relevant lines from file ".Xresources":

$ grep ^Emacs .Xresources
Emacs*font: -bitstream-bitstream vera sans mono-medium-r-*--21-*-*-*-m-*-*-*
Emacs.geometry: 80x40
Emacs.menuBar: 0
Emacs.tabBar: 0
Emacs.toolBar: 0
$

But, sadly, it doesn't work as I expect :-(

Problem 1:

The edge of the physical screen cuts off part of the right scrollbar and
the right window decoration  of the initial frame  opened by the "emacs"
command above,  a vertical stripe  of approximately 14 pixels width, and
the window manager  reports the window geometry  as "79x40"  rather than
"80x40".  However, the frame's top edge is placed correctly 6 pixels be-
low the physical screen's top edge.

Problem 2:

When I open another frame by entering "C-x 5 C-f", the new frame has the
correct geometry of "80x40",  but is positioned at "+484+0"  rather than
at "+150+6",  and any further frame opened  is placed  29 pixels  to the
right rather than at the very same position as the previous frame.

What am I missing?  Any help appreciated :-)

Sincerely,
  Rainer



reply via email to

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