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#63949: 30.0.50; =?UTF-8?Q?`vc-print-log=C2=B4?= does not erase buffer when called from *vc-change-log* buffer, at least for CVS logs Date: Sat, 10 Jun 2023 20:23:06 +0300 Message-ID: <83ilbvz0xx.fsf@gnu.org> References: <8c62dd9a-3cad-b992-bfc4-64b2f1db4485@vodafonemail.de> <87fs729jxu.fsf@ledu-giraud.fr> <7bc0c78e-e4b5-0edc-0e9f-2f8fbafc352f@vodafonemail.de> <83y1kt180v.fsf@gnu.org> <8477db3b-b237-aa4b-b4aa-41d31cb77ac1@vodafonemail.de> <834jnf26v2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17053"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63949@debbugs.gnu.org, manuel@ledu-giraud.fr To: Jens Schmidt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 10 19:24:16 2023 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 1q82K0-0004EY-A8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Jun 2023 19:24:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q82Jn-000352-NF; Sat, 10 Jun 2023 13:24:03 -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 1q82Jm-00034f-HQ for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2023 13:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q82Jm-0008LJ-8a for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2023 13:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q82Jl-0002Ec-PD for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2023 13:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Jun 2023 17:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63949 X-GNU-PR-Package: emacs Original-Received: via spool by 63949-submit@debbugs.gnu.org id=B63949.16864177888515 (code B ref 63949); Sat, 10 Jun 2023 17:24:01 +0000 Original-Received: (at 63949) by debbugs.gnu.org; 10 Jun 2023 17:23:08 +0000 Original-Received: from localhost ([127.0.0.1]:36194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q82It-0002DH-PG for submit@debbugs.gnu.org; Sat, 10 Jun 2023 13:23:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q82Ip-0002CX-6U for 63949@debbugs.gnu.org; Sat, 10 Jun 2023 13:23:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q82Ii-0008If-7f; Sat, 10 Jun 2023 13:22:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=U+DUBQ8YJ+yFqKKk7jTUNzXXgkqId9Y1FaCJASP7Mb4=; b=Fx++oiGiIBr7Sn5rVwsA eGKjHw48yUQ73Nx9xOvCJ89kNZciUZGBaoBJZe/PwlyfqVs1jIjdSs5c/17tt03xjMioFdLfpTF00 ToEIpIgRyKGFVV/vWrJaPot5vY44PCGB6ALipgC05/EQAcsx0JiSb5AOrw+maaHsJW2B++TZaZNJM /p+vYUdkax++vhGEJ8SbXKu/hm6PaAs/IpzKIL+y0cOFhH7679/2MItrhAjQL6Z+YZtMjvY85xqAh SrSU8I1WfD113xZPXbEjG+KBxbK4tT1+L8utc7lylLFKK2scCqSuojVJoUnhcHs2LeA9L/C3uNgnc WN9uCLVStMHgtg==; Original-Received: from [87.69.77.57] (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 1q82Ih-0003vU-OZ; Sat, 10 Jun 2023 13:22:56 -0400 In-Reply-To: (message from Jens Schmidt on Sat, 10 Jun 2023 17:44: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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263228 Archived-At: > Date: Sat, 10 Jun 2023 17:44:26 +0200 > Cc: manuel@ledu-giraud.fr, 63949@debbugs.gnu.org > From: Jens Schmidt > > On 2023-06-10 08:01, Eli Zaretskii wrote: > > > Why do you think it's a problem? I can justify this behavior, at > > least in some use cases. > > Let's distinguish "VC-controlled buffers" like the buffer of a > VC-controlled file or a *vc-dir* buffer or a dired buffer of > VC-controlled directory. And "VC working buffers", like > *vc-change-log*, *vc-log*, *vc-diff*. First, let me clarify what I alluded to as "a problem": I meant the fact that "C-x v l" in a *vc-change-log* buffer shows the log for the entire repository. How this is accomplished by setting vc-parent-buffer is an implementation detail. > It is my understanding that `vc-parent-buffer' in a VC working buffer > points to the VC-controlled buffer from which it originates. The > rationale of that variable is to allow VC operations from a VC working > buffer as if executed on the original VC-controlled buffer. So I can do > C-x v l, pick a commit, do a C-x v ~ on that commit, then a C-x v =, and > all these operations would automagically relate to the original > VC-controlled buffer. At least I use that concept frequently. If the backend is a VCS that records changes per-file, what you want will happen automatically, since "C-x v l" and other operations must in general refer to a file with those VCSes. For backends that record changes per-repository, why does it make sense that typing "C-x v l" from a buffer that already shows a log should produce the same log again? > The documentation on `vc-parent-buffer', unfortunately, is out of date > and does not necessarily support my understanding: > > ;; In a log entry buffer, this is a local variable > ;; that points to the buffer for which it was made > ;; (either a file, or a directory buffer). We need to define what we want vc-parent-buffer to mean, and then we should adjust the documentation and keep our promises about that variable in the future. > However, this has been working as described by me up to and including > Emacs 27. So at least we can say that the fix fur bug#40967 has changed > established behavior. Probably because no one realized that this must be the established behavior. > That logic used to work as intended (by me) up to Nathan's commit, which > put a `with-current-buffer' around the whole function and rendered the > `set-buffer' side effect pointless. > > Let's put it that way: The pre-28 logic of handling the VC parent buffer > was not necessarily clean, as also pointed out by Stefan. But I think > the concept of having a stable VC parent buffer across multiple VC > operations is nice, and changing it midway according to rather unclear > rules undesirable. > > Ideally, we would have a fix that handled indirect buffers and VC parent > buffers (which are somewhat similar by concept) all consistently and > nicely and in a stable way, at the same time fixing both issues that I > have. I'll mediate about that... If you can suggest changes to make the treatment of vc-parent-buffer more consistent, that would be good, I think. I'd also like to hear Dmitry's views on these issues. He was until now silent in this discussion, AFAICT.