From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Question about dubious code for terminal frames Date: Mon, 02 Sep 2024 16:54:31 +0200 Message-ID: References: <86wmju8em4.fsf@gnu.org> <86ed628aa3.fsf@gnu.org> <868qwa86nq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15339"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org, rudalics@gmx.at To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 02 16:55:24 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sl8Si-0003oJ-Mv for ged-emacs-devel@m.gmane-mx.org; Mon, 02 Sep 2024 16:55:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sl8S0-0007yz-T6; Mon, 02 Sep 2024 10:54:40 -0400 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 1sl8Rw-0007gm-NY for emacs-devel@gnu.org; Mon, 02 Sep 2024 10:54:37 -0400 Original-Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sl8Rv-0007uv-2b; Mon, 02 Sep 2024 10:54:36 -0400 Original-Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a86abbd68ffso710077966b.0; Mon, 02 Sep 2024 07:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725288873; x=1725893673; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fFbBk732SNQcm13RT4bWDDGVhmK4zyfgUj63PGEDdV0=; b=hVpXjuEsjvZp6fEHZv+bnTXMsP/bSGn7QJktw95BCfgk7x0lqzJFiIBtEUMIbOp9J1 rCObGRTp+CSAxMcGNQ26Xs9yKNqksrLDnfoUVBenBAYvCDPBxwSw5NVSCAJhvBIzc8os UjcE5Cks6qwJ3rnFibFve4MpZ/SFELC2B5Q8AdrH2fo5/J4y38M1hpcq0AgHCH9RRvSS 5rGFBPW6amfRBp5yzJy5+FR6Aa0iruBrymlYxqSDz2R+JckiPxbu01aaWkPno5LuQPtZ C7V5fTJ7D5+zEmbTQg5frLomMyeSgrRtcdbMVxvrAwVkRfnQJwzYdnZPb5V+RmKOF83O rvIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725288873; x=1725893673; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fFbBk732SNQcm13RT4bWDDGVhmK4zyfgUj63PGEDdV0=; b=rXj/m2PcT+TydpzIPDVR9YA5RQNLKSAxTrcKggfzW7jT+eOKUYhFBob5iilBLj8rvq K3l1FQVVteBvakxWeu7fXxlb8X/JdcjgpNhTj2Zgp7fSTm2GFsMJir/qDVFRLgaJqniT gd44sOiK7wM2AO3ynHomz/4+LCOZw1+FWJ1hdEuKZHpuAnHfqweN8ZgHZDppN59Q+FnF oLOW6+8Nf6kSeOc1lG//adjixfmLP0M/I3QW9CSDysMaxzVuj91j0IkB4yR3c3GKFMVV aN14mYEb5F0Dt72/abjpQ4kUiAvN5VK5mXk9BEef6UpRDBOaBOlqigrs6Qt4IAjyfpoZ NBjw== X-Gm-Message-State: AOJu0Ywz3E0Qtl5wrOOymw50hj8JprQ4la3fDC3lZT4M184KThh2iYol Bn/PdszX3UkqGKcLbqfJj+0NamDoY7XypDK6yWfXCfZIZ4ND64TxOGc9Bw== X-Google-Smtp-Source: AGHT+IFxXqvMOk1OMmuZR/DakDsQ4B28CSGkS3KuTvGCBZFBYzCE3edTc/g/F9jL4YI0DmogbIEm7w== X-Received: by 2002:a17:907:d589:b0:a7a:c7f3:580d with SMTP id a640c23a62f3a-a89a2924ab3mr1030713566b.25.1725288872771; Mon, 02 Sep 2024 07:54:32 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a928.dip0.t-ipconnect.de. [79.227.169.40]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a898919695csm564806166b.117.2024.09.02.07.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 07:54:32 -0700 (PDT) In-Reply-To: <868qwa86nq.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Sep 2024 17:35:53 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323294 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: emacs-devel@gnu.org, rudalics@gmx.at >> Date: Mon, 02 Sep 2024 16:11:34 +0200 >>=20 >> Eli Zaretskii writes: >>=20 >> > What exactly is the problem? Doesn't change_frame_size support child >> > frames? >>=20 >> Not on terminals, no, for exactly the reason that adjust_frame_size for >> terminal frames sets the terminal's size. So, when I opened a new child >> frame of size 20x30 suddenty the terminal had size 20x30. And the >> innocent root frame redisplay got an emacs_abort because it wrote >> outside of that range because the root frame was of course much larger. > > OK, but the behavior on TTY terminals in this regard should be exactly > the same as on GUI terminals, when you drag the frame's border with > the mouse. So I very much hope there's code in Emacs that you can > simply copy or maybe even just call. Well, an easy cop-out is to not set FrameCols/FrameRows for child frames. Seems to work, but it's not a solution. Hence my question here. >> I personally think it's wrong to set FrameCols/Rows in this way in >> adjust_frame_size. From my POV, it's should be a physical property of >> the terminal that Emacs does not change. If we can't determine the size >> of the terminal (and I wonder how often that is the case), we should >> devise a way to let the user specify the size, but without the current >> magic.=20 > > But with the current proliferation of terminal emulators whose window > can be resized, what other choice do we have when the only source of > information about the resize is SIGWINCH? How else can we update the > Emacs notion of the frame's size? See get_tty_size which the SIGWINCH handler already calls. We could use that to get the physical dimension of the terminal. Only problem are terminals not supporting one of the methods get_tty_size knows, for example the co/li escape sequences. We'd need some way to let the user specify the terminal size for that case. Outside of get_tty_size I'd make FrameCols/Rows const. I guess that frame size changes could remain as is. Only that setting FrameCols/Rows is none of their business. It's an input for them, not an output.