From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov 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: Sun, 18 Jun 2023 05:42:44 +0300 Message-ID: <1c00eecf-9285-3b9e-cf9f-4eba56461ae7@gutov.dev> 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> <83ilbvz0xx.fsf@gnu.org> <7fe39b49-8319-d7ab-99b3-afe10dc62177@vodafonemail.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23562"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cc: 63949@debbugs.gnu.org To: Jens Schmidt , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 18 04:43:29 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 1qAiNz-0005tk-BX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Jun 2023 04:43:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAiNd-0008Mj-36; Sat, 17 Jun 2023 22:43:05 -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 1qAiNa-0008ML-TI for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 22:43: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 1qAiNa-0005p4-L9 for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 22:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qAiNa-0003Io-3r for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 22:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Jun 2023 02:43:02 +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.168705617912685 (code B ref 63949); Sun, 18 Jun 2023 02:43:02 +0000 Original-Received: (at 63949) by debbugs.gnu.org; 18 Jun 2023 02:42:59 +0000 Original-Received: from localhost ([127.0.0.1]:52866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAiNW-0003IX-NE for submit@debbugs.gnu.org; Sat, 17 Jun 2023 22:42:59 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:39687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAiNT-0003IH-32 for 63949@debbugs.gnu.org; Sat, 17 Jun 2023 22:42:57 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 038C15C00CD; Sat, 17 Jun 2023 22:42:50 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 17 Jun 2023 22:42:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1687056169; x=1687142569; bh=1PfYCnWjUDDC6Sj6wkcWayQVnvVlCivZoiU wzfGPmHA=; b=W8yG6L7VUA/PsCffxQsC8psDtYm0YWS9gEp3AHBW2gqfEUS+cEj lRUGfsAoZwc/Xh3hMJOdAUlRls13Wquh1SUtXLk/kFwW1kTWX/cV+7KvDLQAunQx 2Rq+3thbDxQ4Qy9IRNSb5cJKvJtz5v5ajfiltXPgXLqkOEIQWIAaFu1CTGuIh9/+ oXG93ob4IlZi9kJGNaQhTBnrpP5AZx6PuB5EwAFTpuUIbvqVF2a8vfhT/RAyrUMj 3k+QMidvfV9LbUcIb9sXzPqTrCY9RDoUsGr4tgjVNXyP1TnOk8RP3zgrz4a1G5ac xiGmyNtNM7dCxUBolJooigt2NQt5yRfMA1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1687056169; x=1687142569; bh=1PfYCnWjUDDC6Sj6wkcWayQVnvVlCivZoiU wzfGPmHA=; b=orYoklo8l0666kcklcHJ6fFwQPszZvneiAORei2VAvnpb70AY/O B2XSLSb2AtQjQVVWNIa6tHI5y3qWu1Xoqw039b+K/uilW1MQ3zn9StWkttIXMIsn pgQRTPfKFJI0N9veTpR3NTIzCrpAoOmnXNvBSzIVENsujeL1lW2mQls+WdfjJfk4 wAxbC4L+Dqw23DxFzMNN8ijOY5B5QZIb4hAbOWTCjjEK6wZuhN5OL2YFdjlD+Mr3 b4PO+hFgOpB+J77S0XxQfMO6bYUborBtE4/u+KZV1gJZM2EQ/NszAk87xjc9AAxZ ZqRa6oRFRGGytzgnA2tCkPIFDXprE4TiBkg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedvkedgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 17 Jun 2023 22:42:48 -0400 (EDT) Content-Language: en-US In-Reply-To: <7fe39b49-8319-d7ab-99b3-afe10dc62177@vodafonemail.de> 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:263596 Archived-At: On 16/06/2023 22:33, Jens Schmidt wrote: > On 2023-06-10  19:23, Eli Zaretskii wrote: > >> I'd also like to hear Dmitry's views on these issues.  He was until >> now silent in this discussion, AFAICT. > > @Dmitry: What's your view on these issues?  Just making the handling of > VC parent buffer more documented and "more consistent", whatever that > means, or do you prefer some particular direction? I think the appropriate thing here is to back out of the change that caused the regression (d494833d47968fcd97ba549654a259d6fb6c2eee, as we've found out) and then try to re-fix it some other way (in master?). Or maybe adjust the current code such as when vc-deduce-fileset-1 does change the current buffer, vc-deduce-fileset retains that change. For example, using this ugly-ish (100% untested) patch: diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 91d3f6f70d3..91aae40a677 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1121,10 +1121,13 @@ vc-deduce-fileset the returned list. BEWARE: this function may change the current buffer." - (with-current-buffer (or (buffer-base-buffer) (current-buffer)) - (vc-deduce-fileset-1 not-state-changing - allow-unregistered - state-model-only-files))) + (let (new-buf) + (with-current-buffer (or (buffer-base-buffer) (current-buffer)) + (vc-deduce-fileset-1 not-state-changing + allow-unregistered + state-model-only-files) + (setq new-buf (current-buffer))) + (set-buffer new-buf))) (defun vc-deduce-fileset-1 (not-state-changing allow-unregistered The fact that some backends do call vc-setup-buffer inside vc-xx-print-log and some dont', also bears investigation. But the question I would like to have answered is, can we drop this call from all of them? Rather than trying to add it everywhere.