From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#57837: 29.0.50; fit-window-to-buffer should reposition the buffer Date: Fri, 16 Sep 2022 19:34:41 +0000 Message-ID: <84acc36e7e03e4cba89d@heytings.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4488"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57837@debbugs.gnu.org To: Sam Steingold Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 16 21:35: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 1oZH7G-0000ss-U8 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 21:35:10 +0200 Original-Received: from localhost ([::1]:58416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZH7G-0006Ke-0Q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 15:35:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZH78-0006KS-RB for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 15:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZH78-0007ED-H3 for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 15:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZH78-0004ed-Cc for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 15:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 19:35: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.166335688417863 (code B ref 57837); Fri, 16 Sep 2022 19:35:02 +0000 Original-Received: (at 57837) by debbugs.gnu.org; 16 Sep 2022 19:34:44 +0000 Original-Received: from localhost ([127.0.0.1]:44394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZH6q-0004e3-Cb for submit@debbugs.gnu.org; Fri, 16 Sep 2022 15:34:44 -0400 Original-Received: from heytings.org ([95.142.160.155]:44996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZH6o-0004dv-QQ for 57837@debbugs.gnu.org; Fri, 16 Sep 2022 15:34:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1663356882; bh=04nwqriuRz5Fpu2DXlebZEcgM7cJ6QC3ETu/45qtdsI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=aAFqm8JybgYImA4hdCOV67r4vwl83QCXegOf8rqBbjnYkAocorgC5jDKB1xu14FuV cM7XP4clXbARmaoU64KL5G7WGQ84s+wJGdry21KDmWe61FraGohzG71zSAALwSs66L h8tgrhBnayu1Y/W4Tp4ZxelH6LqcF/JhQif+JdCMPUfSnpS98khttCkG45oduLID4J gSRIC9a432Tn4x45bzbM74Ic8kWIEaHHiHnuL7DkfiJKaPt+DloVOnuO+gldT0letO uDdKCjBFMq9yIC8rZNJp/khA13MK+oOisFxO96MZ46mNEhlpA6LfUMEn9hcXJLMT8B Peu0Gr/nCVUfw== In-Reply-To: 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:242805 Archived-At: >>>> (advice-add 'fit-window-to-buffer :after >>>> (lambda () (and (= (count-lines (point-min) (point-max)) (1- (window-height))) >>>> (or (< (point) (point-max)) (forward-line -1) t) >>>> (set-window-start nil (point-min))))) >>> >>> Why shouldn't this be the default behavior? >> >> I think because fit-window-to-buffer isn't supposed to move point, and >> point would become invisible if it is not moved. > > Is that a problem? I mean, is it possible for the point to be invisible? > No, Emacs does its best to ensure that point is always visible. That's the reason of the scrolling you see: without scrolling (which hides the first half of the buffer) point would be invisible.