unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Problems positioning and sizing Emacs frames
@ 2022-12-19 18:29 Dr Rainer Woitok
  2022-12-20  1:41 ` Po Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Dr Rainer Woitok @ 2022-12-19 18:29 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-20 17:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-19 18:29 Problems positioning and sizing Emacs frames Dr Rainer Woitok
2022-12-20  1:41 ` Po Lu
2022-12-20 11:37   ` Dr Rainer Woitok
2022-12-20 12:32     ` Po Lu
2022-12-20 13:34       ` Dr Rainer Woitok
2022-12-20 13:48         ` Po Lu
2022-12-20 17:50           ` Dr Rainer Woitok

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).