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 20:02:24 +0200 Message-ID: References: <86wmju8em4.fsf@gnu.org> <86ed628aa3.fsf@gnu.org> <868qwa86nq.fsf@gnu.org> <867cbu842s.fsf@gnu.org> <7f6a1078-6780-43df-9ca5-ed500c7434a1@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32896"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 02 20:03:27 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 1slBOf-0008JE-UO for ged-emacs-devel@m.gmane-mx.org; Mon, 02 Sep 2024 20:03:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slBNo-0001Kd-GR; Mon, 02 Sep 2024 14:02:32 -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 1slBNm-0001KR-T0 for emacs-devel@gnu.org; Mon, 02 Sep 2024 14:02:30 -0400 Original-Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slBNl-0002rR-5W; Mon, 02 Sep 2024 14:02:30 -0400 Original-Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2f406034874so53564291fa.1; Mon, 02 Sep 2024 11:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725300146; x=1725904946; darn=gnu.org; h=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=EX6Mznu9T47AT39KBSkqXSCnam3bfIzhjZhWK4xAhyI=; b=MZBqjLpinFe3eJS+sSWLUXajwNLfSj501UUd4fHNREUpMvKNdXOEgzp6Z+L5hpAU+I Kj7/l9ejjZ9m13e3IHRmbUcc7VQ6c/ll1LfmDk6FC4XfCQgLik8MiRVFZ4AZx5a5ytW1 ttD9LeqiiSrx4woz7tvEt3fWoThminWVKGg8Rd+gogjKAGuftXzrIJCuMWedV4JbJMPz RFTmYJ5t+wsqZqfM3PHwLxY/pUNwbtNxLLq0laMyFS3GFzLV9k9zEZiqtDbKHJ4uC3uz 0rKJ8cLGaP4Ix16sMbLn1+6j0ahuJ6VAFPU3okgQvuPBVvXjKRo704GudXCd7RZ6n/b2 wlVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725300146; x=1725904946; h=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=EX6Mznu9T47AT39KBSkqXSCnam3bfIzhjZhWK4xAhyI=; b=cd7ba0VnvLy6mITQxfmng6+LfyEcPAlHgJ4XHywsBxtfH/SN7HrmBZ/3EwrPm5hL0p c7JzicMUc37avEC3XImlEGm1GFFMRWoxXz+yGIT2Oq8r1DnxWvS4h7YxK4s/ArDkrizH uaxWB99O1nBBchVa09jABtDVH82hib/K31nt5XHwlobKIWohbRQOTxHSe7q3yyYScVA9 Bs1BGOj+1lYoQvPpHRExAlQcqvZ155oOyChgznPsTlFDujkLZmgnJ4DRqhhjUeuq/fsy mBei6CvriP4Oazz7gT3MDCDNFqeZujRIxO9OfTLKB0H6OKIkxZpCdRJcQ9mAM7ZEjM9c FGlw== X-Forwarded-Encrypted: i=1; AJvYcCVW7++/fSjhJtuZkRmCsbgNIu8KEJUNIBMvEX8PtkdeYpw1mU68JJ+PYQEDyDBRKnRmt06P/KmfXwN21A==@gnu.org X-Gm-Message-State: AOJu0YyGmp121P9sY0u3MRtLK5JAGrJ/M0xEUX5yN0XO2SJI7okvIb4X pCpMK78O2XiQ+w+SJinv3S4FyaiHPhW3NLEFbKUj1Nmg5q3lTShxfwbuQg== X-Google-Smtp-Source: AGHT+IG3sMgpU342aAbZsc1NHSbu//2PA2dOrmF5Hr7rgvCjvr18ZT4AFUKgIwXB6uvRYVSS96NmEw== X-Received: by 2002:a2e:d02:0:b0:2f5:806:5cee with SMTP id 38308e7fff4ca-2f6105cbaf6mr92522751fa.11.1725300146042; Mon, 02 Sep 2024 11:02:26 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a928.dip0.t-ipconnect.de. [79.227.169.40]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c226c7c076sm5538776a12.46.2024.09.02.11.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 11:02:25 -0700 (PDT) In-Reply-To: (martin rudalics's message of "Mon, 2 Sep 2024 19:32:11 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=gerd.moellmann@gmail.com; helo=mail-lj1-x22e.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:323307 Archived-At: martin rudalics writes: >> I think I have the above here. It reads >> >> /* Assign new sizes. */ >> FRAME_COLS (f) = new_text_cols; >> FRAME_LINES (f) = new_text_lines; > > It might cause something weird in resize_frame_windows, but that's maybe > only here. > >> Anyway. My problem is setting FrameCols/Rows in adjust_frame_size. It's >> not guaranteed that the terminal's size has indeed changed when that is >> done. > > You mean the > > FrameRows (FRAME_TTY (f)) = > FrameCols (FRAME_TTY (f)) = > > assignments? Exactly. > These are from the pre-2014 change_frame_size_1 code with the comments > mostly preserved and governed by similar conditions. Do you think > something changed here? Actually, I wondered if this might be something I overlooked when writing the new redisplay. Last century :-). Alas, there were so many changes in the meantime. that I give up trying to find out. > But I agree that for child frames with their own smaller dimensions > these assignments should be obviously skipped. Yes, for child frames it's certainly wrong. And I can easily work around that. What I wonder is if it's the right thing to do for normal frames, as well. What happens if I make-frame a second non-child tty frame with frame parameters that lead to the FrameRow/Col assignments with smaller values? If that happens, the terminal appears to have changed size, which it of course hasn't. And redisplaying the first frame might trigger an emacs_abort in cmcheckmagic that tries to make sure that we don't write beyond the terminal borders, which have been set by the new fraem. And more general, I wonder why setting the physical terminal size in adjust_frame_size is the right thing to begin with. I believe determining the terminal size should happen elsewhere and the size is and input to the algorith resizing frames. I don't know whqt Eli thinks about this, as you might have noticed :-)