From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#52855: vc-shrink-buffer Date: Wed, 29 Dec 2021 10:23:08 +0200 Organization: LINKOV.NET Message-ID: <86tuer3jhb.fsf@mail.linkov.net> References: <867dbosit6.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1702"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 52855@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 29 09:30:19 2021 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 1n2ULj-00009o-NH for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Dec 2021 09:30:19 +0100 Original-Received: from localhost ([::1]:56146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2ULh-0003yt-LM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Dec 2021 03:30:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2ULT-0003yV-4H for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2021 03:30:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36467) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2ULS-000575-RN for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2021 03:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2ULS-0000s5-Lt for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2021 03:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Dec 2021 08:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52855-submit@debbugs.gnu.org id=B52855.16407665543272 (code B ref 52855); Wed, 29 Dec 2021 08:30:02 +0000 Original-Received: (at 52855) by debbugs.gnu.org; 29 Dec 2021 08:29:14 +0000 Original-Received: from localhost ([127.0.0.1]:48013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2UKf-0000qi-St for submit@debbugs.gnu.org; Wed, 29 Dec 2021 03:29:14 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:41687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2UKe-0000qV-5V for 52855@debbugs.gnu.org; Wed, 29 Dec 2021 03:29:12 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 1A0641C0005; Wed, 29 Dec 2021 08:29:04 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Wed, 29 Dec 2021 01:53:26 +0200") 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:223310 Archived-At: >> When no shrink is needed, two new hooks are added in this patch >> with the default value containing vc-shrink-buffer to preserve >> the current behavior that can be easily removed in user configuration >> by e.g.: >> (remove-hook 'vc-diff-finish-functions 'vc-shrink-buffer) >> (remove-hook 'vc-log-finish-functions 'vc-shrink-buffer) > > So the idea is to allow customizing this behavior off? > > For those users who don't see the benefits? What for one is a benefit, for others is an annoyance. > LGTM. Before pushing I only have a doubt about 'vc-shrink-buffer'. Currently it's a wrapper around 'shrink-window-if-larger-than-buffer' that has nothing to do with vc: (defun vc-shrink-buffer (&optional buffer) "Call `shrink-window-if-larger-than-buffer' only when BUFFER is visible. BUFFER defaults to the current buffer." (let ((window (get-buffer-window buffer t))) (when window (shrink-window-if-larger-than-buffer window)))) Maybe it should be in window.el and renamed to shrink-buffer-if-larger-than-buffer