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 14:59:54 +0200 Message-ID: References: <86wmju8em4.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="34755"; 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 15:00:56 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 1sl6fw-0008oR-2J for ged-emacs-devel@m.gmane-mx.org; Mon, 02 Sep 2024 15:00:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sl6f3-0000i2-Sy; Mon, 02 Sep 2024 09:00:01 -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 1sl6f1-0000hi-Jz for emacs-devel@gnu.org; Mon, 02 Sep 2024 08:59:59 -0400 Original-Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sl6f0-0003nT-2z; Mon, 02 Sep 2024 08:59:59 -0400 Original-Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-5343eeb4973so6409553e87.2; Mon, 02 Sep 2024 05:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725281996; x=1725886796; 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=rajfDUyonkNzBtK7QnRve092PdQ1BGZpuV3b1t2N+GU=; b=F09r3rlU1N3ruMxpbvRpUvlzu9nnmDJQKghFNzkex+7GCPy09id9n3e7+3xiiBhiV5 fARvVJmQvjDF7yXlhW79QpALuD9nIy6BAv/o2aR6m13L1liN7IT//eZEoI7xfJFCFiOQ tJrTZvz818+/MpwQb/1pfC1qzeFTenxsZFEi7usQocGpeLzqRFINI+LZNCqyMaamxSbH frGOWQVN+1Wlxokq2TKztlTTVTCox0RtZE6om7OffFGpSBvX2+xpXjxnobr3iU2kwRVb AxCdn/YXFeAKUNLDkCXZ70Pn6uY85L8tV8mqJKH0Uqv3DGGhEoCdJcm3AcOwmePJfQJT L3sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725281996; x=1725886796; 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=rajfDUyonkNzBtK7QnRve092PdQ1BGZpuV3b1t2N+GU=; b=QEF4mIWCvcyLzcdBZZkxJR+0EMiSN9tcwcelBnIAfL4GIOAvyxU1dwMnMJbnFYhZN7 X1n8Fbp1VgVvm4Qhu1T1Yv3JJDySCsscdR/Of/9Z7wls90Vje5o3rGrluK9tm0Pas7Hi 8g+hILwO7/NKB0qRLbZJC9smqJN4xUdvy9tZIIZCBmTiS8Qrj+29zFin+W50zqcaqFGs Lj6B58rsg5dX1lQMfBmboWOX7IKk9TrZsyME+JBpaMN8UphO1GEJ/XPYQ1uZbPBXH4GH GLZ/B93QbeWkMMRnmy09/IEa2UOJRtRzceg9nd1Z+v/44PKRBn0p8wQ9SDHKhQrETzt/ VPMQ== X-Gm-Message-State: AOJu0YyoYhCJZ9tplmj+4F9yo+AVoyaK+cJAE3NeM6/TQTgEdNSheiX+ JjByk4ESaa48wUC5LcIHTu1c6bmgZBayVygKr4JJFj/N4ygOkl7J X-Google-Smtp-Source: AGHT+IEezWijNB5qwf95eTChQ9E/a6FO7kYQIFCIoRyL0YjC4LoPRl8x3c7Wb02p+DNEW/88huVM+g== X-Received: by 2002:a05:6512:3054:b0:52c:76ac:329b with SMTP id 2adb3069b0e04-53546b5da64mr9602817e87.35.1725281995435; Mon, 02 Sep 2024 05:59:55 -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-a8989092143sm559276366b.96.2024.09.02.05.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 05:59:55 -0700 (PDT) In-Reply-To: <86wmju8em4.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Sep 2024 14:44:03 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=gerd.moellmann@gmail.com; helo=mail-lf1-x130.google.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:323286 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: martin rudalics >> Date: Mon, 02 Sep 2024 11:04:02 +0200 >>=20 >> In 3 places, among them adjust_frame_size, which is why I CC'd >> Martin, Emacs sets the values of FrameRows/FrameCols. >>=20 >> AFAIU, these two values give the physical size of a terminal (screen, >> window), as returned from the co and li escape sequences on termcap >> frames. And I can't find code that tries to change the physical size of >> the terminal, if that would even make sense in the first place :-). So >> this doesn't make any sense to me. > > Did you consider SIGWINCH? Its handler also calls adjust_frame_size. Thanks, that would be this one, right? static void handle_window_change_signal (int sig) { int width, height; struct tty_display_info *tty; /* The frame size change obviously applies to a single termcap-controlled terminal, but we can't decide which. Therefore, we resize the frames corresponding to each tty. */ for (tty =3D tty_list; tty; tty =3D tty->next) { if (! tty->term_initted) continue; /* Suspended tty frames have tty->input =3D=3D NULL avoid trying to use it. */ if (!tty->input) continue; get_tty_size (fileno (tty->input), &width, &height); if (width > 5 && height > 2) { Lisp_Object tail, frame; FOR_EACH_FRAME (tail, frame) { struct frame *f =3D XFRAME (frame); if (FRAME_TERMCAP_P (f) && FRAME_TTY (f) =3D=3D tty) /* Record the new sizes, but don't reallocate the data structures now. Let that be done later outside of the signal handler. */ change_frame_size (f, width, height, false, true, false); } } } } It also could know and set the terminal size, if get_tty_size can. How complicated. I guess I rather work around this for now :-). And I wonder if one could brew a make-frame with some suitable frame parameters that lead to setting the terminal size to something that leads to a later emacs_abort in cmcheckmagic during redisplay of another frame on the same terminal :-).