unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Dr Rainer Woitok <rainer.woitok@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Problems positioning and sizing Emacs frames
Date: Tue, 20 Dec 2022 09:41:35 +0800	[thread overview]
Message-ID: <874jtqetrk.fsf@yahoo.com> (raw)
In-Reply-To: <25504.44446.960135.252447@tux.local> (Rainer Woitok's message of "Mon, 19 Dec 2022 19:29:50 +0100")

Dr Rainer Woitok <rainer.woitok@gmail.com> writes:

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

Your window manager decided to force some kind of sliding behavior on
Emacs.  Unfortunately, that is outside of Emacs's control.



  reply	other threads:[~2022-12-20  1:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 18:29 Problems positioning and sizing Emacs frames Dr Rainer Woitok
2022-12-20  1:41 ` Po Lu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jtqetrk.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rainer.woitok@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).