From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#57837: 29.0.50; fit-window-to-buffer should reposition the buffer Date: Thu, 15 Sep 2022 22:00:36 +0300 Message-ID: <838rmk5up7.fsf@gnu.org> References: <838rmkzf9m.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23381"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57837@debbugs.gnu.org To: sds@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 15 21:01:11 2022 Return-path: Envelope-to: geb-bug-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 1oYu6o-0005w6-Oh for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Sep 2022 21:01:10 +0200 Original-Received: from localhost ([::1]:55780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYu6n-0006nc-P6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Sep 2022 15:01:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYu6g-0006nP-Oy for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2022 15:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42244) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYu6g-0001UR-DT for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2022 15:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oYu6g-0002OL-1K for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2022 15:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Sep 2022 19:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57837 X-GNU-PR-Package: emacs Original-Received: via spool by 57837-submit@debbugs.gnu.org id=B57837.16632684569170 (code B ref 57837); Thu, 15 Sep 2022 19:01:02 +0000 Original-Received: (at 57837) by debbugs.gnu.org; 15 Sep 2022 19:00:56 +0000 Original-Received: from localhost ([127.0.0.1]:59176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYu6a-0002Nq-6F for submit@debbugs.gnu.org; Thu, 15 Sep 2022 15:00:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYu6V-0002NO-6k for 57837@debbugs.gnu.org; Thu, 15 Sep 2022 15:00:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54574) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYu6Q-0001TP-0R; Thu, 15 Sep 2022 15:00:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=uVY1kxwr74ofWsPzMUZP1K6+JosHeXVzOSdJu5kqTgY=; b=TreIv6uPskoz wm0ZQRJpmKS0BTrOP5p7lw9WJ93m4HYZlnZlYJry83f+T1Z0XbpjwllV3+hI3c4axle6pPSZDMNI/ W7J2pNMcIytResf5fYsU9bCn2X/FHqfV9aYvYexfVbNmjEkBERMl8m4kOJjmuXzY1zdtPYSK67SU6 VlC3rYdW3IDiArnq5JUu0sL1jnIgLRLQJuEYTp2RvHuTWZoWO6Uw9TsQjCJlq+DvaDW9SlETLEdBx 0mrJydI5o8I/yiPOlqt2KFCT4poA0sCVrIoCnRe23z5HMU6rhO1MJMnPE5rYHgnbYKO/2MxfadKCe bKRUO/qzHSVGYW+jEVOcLg==; Original-Received: from [87.69.77.57] (port=1990 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYu6O-0005Jh-6p; Thu, 15 Sep 2022 15:00:45 -0400 In-Reply-To: (message from Sam Steingold on Thu, 15 Sep 2022 14:30:36 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242633 Archived-At: > From: Sam Steingold > Cc: 57837@debbugs.gnu.org > Date: Thu, 15 Sep 2022 14:30:36 -0400 > > >> Basically, after `fit-window-to-buffer' is called, the following should > >> evaluate to t: > >> > >> --8<---------------cut here---------------start------------->8--- > >> (and (pos-visible-in-window-p (point-min)) > >> (pos-visible-in-window-p (point-max))) > >> --8<---------------cut here---------------end--------------->8--- > > > > No, because point-max is after the last newline, and thus effectively > > one line beyond the window's text. > > As I said, if `fit-window-to-buffer' has a "contract", it's the invariant > above. Violating it, albeit in a corner case, is, IMO, a bug. I think you misunderstand the contract: the function fits the window to the buffer text, which doesn't include the (imaginary) place beyond the last character. When you are are EOB, doesn't "C-x =" say something like point=N out of N-1 (EOB) ? Do you see what I mean by "beyond the last character"? > I am not sure how this should be fixed It shouldn't be fixed, because it ain't broken.