From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.help Subject: Re: Problems positioning and sizing Emacs frames Date: Tue, 20 Dec 2022 09:41:35 +0800 Message-ID: <874jtqetrk.fsf@yahoo.com> References: <25504.44446.960135.252447@tux.local> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39696"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: Dr Rainer Woitok Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 20 02:42:40 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p7ReR-000A6m-NS for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 20 Dec 2022 02:42:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7Rdj-0000Sv-Ot; Mon, 19 Dec 2022 20:41:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7Rdi-0000SX-6S for help-gnu-emacs@gnu.org; Mon, 19 Dec 2022 20:41:54 -0500 Original-Received: from sonic304-22.consmr.mail.ne1.yahoo.com ([66.163.191.148]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7Rdg-0003QD-Cs for help-gnu-emacs@gnu.org; Mon, 19 Dec 2022 20:41:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1671500507; bh=iyoQl4eDLz+s1RQFyYOX5OkVG/21tj9NpPfXJ1bwg7c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=CPuyVffl44jAWq5OJk2BGaZClxiiRc1/j269p6GCrtsCjTy7O0LYKaYJnyNS9d1i+naEoqLHCYfI1w5SIYE5NTI5cH8ijEJv+tzyOktdoVdFCrxqr1i44ZCuEo7ko5jXV/8BUAVVehu8V6rpPeV6xrXF974E1h4K7KGlSPSEEmuerjc4zveeS9djjZrVWpB4OW3a0e3+Fj7byfqR7qgg78X0/H0MHAdZXJmFPns/5NgxAYdbiPMKp2kR6yhMTjE5+sIaL8eYMsVAdtbncIxDTMeIL5mXtkhj2Vqy76p3jmn1k5gmq4sBxwdYKRrlUPKp8PonFSe16qHZ8j+SeVPpCQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1671500507; bh=qoLMy50BaBo3HeU3EZxJ/WPWcJE4+Ko5hrTBzZQ/moa=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Yc3JqHbaZMR7C4ygs/0x3L/oHw90QM8JBFqCPrPCGtYgFqT7jB/lpchmQC5TWEAtAJQ/v8iBbsUk9SrF4ClnzDKI5G3BIb8zRBFWq0JUnB/PRKHABgr7kNaIm/ggtbVB4fNHi1uxMaXa9vt8KjKYLqm9MGVqgB6M7hF8YAMaYvnfoA8f9L7WVAhygA1nujUyQVhDH2b/ZBsiYFe7b4WLgaC9wLEkWgec/3/fgXrnFKaQpQKzFUk3kT5B478O0V+7m5eWiYcsvgvVuhcUJveHklGJNL976wz7RsjT9qi+fhAgIvzkcGFIsxUXlDuL5cj6Yk+yeTDl8m5DTzw6Y//8vA== X-YMail-OSG: 7evhgCgVM1mg7l3TVogQmLbJTH2REs58b1JJXypSW7C5hNG.82hSRxCmYhH.fK. GNrWW7mHv.McexKpVnRIzAZCk65ocDJ232mhrI7DGBRedDdOjaQdFwb74G3yI5aHY8dLtKNNa11x 9LS4Nh1mcHRx21lCFwbe0RdZuEYwdXUUZENh8rEbO0VnGjoyOyPPKSBUrBwWmV.Anxvfbr_nbqT6 XsGfTadzWn4sTueaWSe4cw6Vru4W1eLECfnsTD2pN_gMzc1ptH5Pzsvn_I7lxAmwaHJPWVGkWBB3 DoC3N.NDSepgayIMR2dt29NMoK2POgxG84OeXYcbyUyd4CZtuK8sznfRtudbLPwWPg721edy0w4f 0nAvAroIHhQ4F4dvKBzg8nVwq3vOXA_.Tod7MtQszuUIW9.Y318kdLOlv_g7lo3gVT7VLduUz4Lw Zi2o1jXqvDB4_8Ns_3qHdXlsVu0RRtb1Unu0sArbO3eZTFWtSdZsFJBi6kgDzBtp6_89yu0rZKWa VYzc.1J6Fn3kVQ9cuKjWkWNiZwoXUIr6YS4B4DgObpyHxDoiKcGwp.jTFMhpZIRTL4.MvimBrlKM 6OooC9QFB.qV45vz.LaYbExx5eD62eyOE1Js9yyJE_OEdGU3dmrobSTiLNe5D9hkfJdG2SIVA0JC bU2xMQMEUIfPUjVASlZNVQX6Pah4MPg0Q9XkzrZiXQ0D4OqQU.KfiENFgKB0t6IOv6R9OM9vrQRc jm43xuIYz23IPoUOs0Oecv1HxBnAik4Dd.ww4iLxugMwPyrdvnN5Jx3h_Rh3jMI_oz7v4ieKJPY4 ta8tVaG1wCqdPoctIMbITCEmuTNJzto250qCoLYXYa X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Tue, 20 Dec 2022 01:41:47 +0000 Original-Received: by hermes--production-sg3-b666c6484-7jgtw (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 62a70d0978ecf3c0c0644b4305c9a1ca; Tue, 20 Dec 2022 01:41:40 +0000 (UTC) In-Reply-To: <25504.44446.960135.252447@tux.local> (Rainer Woitok's message of "Mon, 19 Dec 2022 19:29:50 +0100") X-Mailer: WebService/1.1.20982 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.191.148; envelope-from=luangruo@yahoo.com; helo=sonic304-22.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141869 Archived-At: Dr Rainer Woitok 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.