From unknown Tue Jun 17 20:39:24 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#28852 <28852@debbugs.gnu.org> To: bug#28852 <28852@debbugs.gnu.org> Subject: Status: make revert-buffer ('g') in VC diff buffers keep point Reply-To: bug#28852 <28852@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:39:24 +0000 retitle 28852 make revert-buffer ('g') in VC diff buffers keep point reassign 28852 emacs submitter 28852 charles@aurox.ch (Charles A. Roelli) severity 28852 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 15:07:50 2017 Received: (at submit) by debbugs.gnu.org; 15 Oct 2017 19:07:50 +0000 Received: from localhost ([127.0.0.1]:41929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3oGL-0000GM-1d for submit@debbugs.gnu.org; Sun, 15 Oct 2017 15:07:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3oGJ-0000G8-7f for submit@debbugs.gnu.org; Sun, 15 Oct 2017 15:07:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3oGD-00035m-AN for submit@debbugs.gnu.org; Sun, 15 Oct 2017 15:07:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49320) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3oGD-00035M-6h for submit@debbugs.gnu.org; Sun, 15 Oct 2017 15:07:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3oGC-0008Dx-8V for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 15:07:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3oG9-0002zf-4c for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 15:07:40 -0400 Received: from sinyavsky.aurox.ch ([37.35.109.145]:60469) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3oG8-0002xm-Rp for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 15:07:37 -0400 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id B098C22578 for ; Sun, 15 Oct 2017 19:00:54 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= subject:subject:to:from:from:message-id:date:date; s=dkim; t= 1508094054; x=1508958055; bh=0agTy5+Yr67Y1JP85vhTub3HnqNnpFZqpbN VvdekD/4=; b=WM1enDutlGPwxcEr/lVlILdlH6bzLjy3+y2YNaVPVSZh8lUjVYf /EoQkSCBgNXGsYEhjJ1apjDCovuPIuRgo1w2JQ0ecHI+c2sMa9xUXw2jPffIGjX8 7aSJ+cYD40CzRIKSfEwOcmvcE4gw+/LhJ6qfOMKU8uwAdJGTHo++/uvw= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VJTcqJbrlTWh for ; Sun, 15 Oct 2017 19:00:54 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 1DBEB2255E for ; Sun, 15 Oct 2017 19:00:53 +0000 (UTC) Date: Sun, 15 Oct 2017 21:07:30 +0200 Message-Id: From: charles@aurox.ch (Charles A. Roelli) To: bug-gnu-emacs@gnu.org Subject: make revert-buffer ('g') in VC diff buffers keep point X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) At the moment, when you hit 'g' in a *vc-diff* buffer, the cursor is moved back to (point-min), which can be annoying. Attached is an attempt at fixing that (using 'replace-buffer-contents' to keep markers/point in the same place). <#part type="text/x-patch" filename="~/Datacar/Code/emacs-devel/0001-Make-revert-buffer-g-keep-point-in-VC-diff-buffers.patch" disposition=attachment> <#/part> From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 13:58:08 2017 Received: (at 28852) by debbugs.gnu.org; 17 Oct 2017 17:58:08 +0000 Received: from localhost ([127.0.0.1]:46560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4W7z-0004FQ-Ll for submit@debbugs.gnu.org; Tue, 17 Oct 2017 13:58:07 -0400 Received: from sinyavsky.aurox.ch ([37.35.109.145]:55737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4W7x-0004Eu-Kt for 28852@debbugs.gnu.org; Tue, 17 Oct 2017 13:58:06 -0400 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id ED1E62257B for <28852@debbugs.gnu.org>; Tue, 17 Oct 2017 17:51:16 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1508262675; x=1509126676; bh=Hngr5WwSQgOqU WbA8jw8h/4LtuLYwoQXF1wUBpCe/94=; b=h4mryYB0WarzO4rO6Qxd/m6LAEdmU IOErvsPKqAvoC9yFqJ+D9Bz3Vo0ReVu472z0wRS9H6wlrQYF7+1dRP90BvMLn++x RCUAQSdqRbSx4f39gOlDO144HB6EYtxhQkmY+3oK+CtTXhbHWQjDgSmhEDj4ilPY Zi3fhldwRpDvVY= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HilOeslNMVUK for <28852@debbugs.gnu.org>; Tue, 17 Oct 2017 17:51:15 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 80E2C22567 for <28852@debbugs.gnu.org>; Tue, 17 Oct 2017 17:51:13 +0000 (UTC) Date: Tue, 17 Oct 2017 19:58:00 +0200 Message-Id: From: charles@aurox.ch (Charles A. Roelli) To: 28852@debbugs.gnu.org In-reply-to: (charles@aurox.ch) Subject: Re: bug#28852: make revert-buffer ('g') in VC diff buffers keep point References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28852 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > Date: Sun, 15 Oct 2017 21:07:30 +0200 > From: charles@aurox.ch (Charles A. Roelli) > > At the moment, when you hit 'g' in a *vc-diff* buffer, the cursor is > moved back to (point-min), which can be annoying. Attached is an > attempt at fixing that (using 'replace-buffer-contents' to keep > markers/point in the same place). Hm, I'll try again: >From 48e3febfee28276b3eb7d9af58342c70d2d798f9 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Sun, 15 Oct 2017 20:58:01 +0200 Subject: [PATCH] Make revert-buffer ('g') keep point in VC diff buffers (Bug#28852) * lisp/vc/vc.el (vc-diff-restore-buffer): New function. (vc-diff-finish): Update its calling convention to include an optional 'oldbuf' parameter, and handle it. (vc-diff-internal): Pass a clone of the incumbent vc-diff buffer to 'vc-diff-finish'. --- lisp/vc/vc.el | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index b80f0e6..57d5a50 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1654,7 +1654,20 @@ vc-diff-switches-list (declare (obsolete vc-switches "22.1")) `(vc-switches ',backend 'diff)) -(defun vc-diff-finish (buffer messages) +(defun vc-diff-restore-buffer (original new) + "Restore point in buffer NEW to where it was in ORIGINAL. + +This function works by updating buffer ORIGINAL with the contents +of NEW (without destroying existing markers), swapping their text +objects, and finally killing buffer ORIGINAL." + (with-current-buffer original + (let ((inhibit-read-only t)) + (replace-buffer-contents new))) + (with-current-buffer new + (buffer-swap-text original)) + (kill-buffer original)) + +(defun vc-diff-finish (buffer messages &optional oldbuf) ;; The empty sync output case has already been handled, so the only ;; possibility of an empty output is for an async process. (when (buffer-live-p buffer) @@ -1666,7 +1679,13 @@ vc-diff-finish (insert (cdr messages) ".\n") (message "%s" (cdr messages)))) (diff-setup-whitespace) - (goto-char (point-min)) + ;; `oldbuf' is the buffer that used to show this diff. Make + ;; sure that we restore point in it if it's given. + (if oldbuf + (progn + (vc-diff-restore-buffer oldbuf buffer) + (diff-mode)) + (goto-char (point-min))) (when window (shrink-window-if-larger-than-buffer window))) (when (and messages (not emptyp)) @@ -1692,7 +1711,12 @@ vc-diff-internal ;; but the only way to set it for each file included would ;; be to call the back end separately for each file. (coding-system-for-read - (if files (vc-coding-system-for-diff (car files)) 'undecided))) + (if files (vc-coding-system-for-diff (car files)) 'undecided)) + (orig-diff-buffer-clone + (if (and (get-buffer buffer) revert-buffer-in-progress-p) + (with-current-buffer buffer + (clone-buffer + (generate-new-buffer-name " *vc-diff-clone*") nil))))) ;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style ;; EOLs, which will look ugly if (car files) happens to have Unix ;; EOLs. @@ -1752,7 +1776,8 @@ vc-diff-internal ;; after `pop-to-buffer'; the former assumes the diff buffer is ;; shown in some window. (let ((buf (current-buffer))) - (vc-run-delayed (vc-diff-finish buf (when verbose messages)))) + (vc-run-delayed (vc-diff-finish buf (when verbose messages) + orig-diff-buffer-clone))) ;; In the async case, we return t even if there are no differences ;; because we don't know that yet. t))) -- 2.9.4 From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 08 14:43:45 2018 Received: (at control) by debbugs.gnu.org; 8 Mar 2018 19:43:45 +0000 Received: from localhost ([127.0.0.1]:51484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eu1S4-0000Vt-Qo for submit@debbugs.gnu.org; Thu, 08 Mar 2018 14:43:45 -0500 Received: from sinyavsky.aurox.ch ([37.35.109.145]:54920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eu1S3-0000Vf-2L for control@debbugs.gnu.org; Thu, 08 Mar 2018 14:43:43 -0500 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 25E88226BE for ; Thu, 8 Mar 2018 19:44:15 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= subject:subject:to:from:from:message-id:date:date; s=dkim; t= 1520538254; x=1521402255; bh=W+IR/b/Iuo5feborxAExGah3/tLQX5KZDdR k6Ec49oY=; b=ukEehOjgIN2SuuX+jNY9ASfag5HemPdCxUndNlcVf962TBxZfpl 8Hk5H9LXxnoZag8wA+/AViuyBgzFmtmsm2pNs0YTkTYUuWC2avBrj3xBjfbyQDyl csMx7/25Uja8uJoXXqL90uIXfYXIpDWpiQdwDMpINnTitn4J4jOQPdV4= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Q17BxA3mkC4y for ; Thu, 8 Mar 2018 19:44:14 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id BD42622688 for ; Thu, 8 Mar 2018 19:44:14 +0000 (UTC) Date: Thu, 08 Mar 2018 20:55:04 +0100 Message-Id: From: charles@aurox.ch (Charles A. Roelli) To: control@debbugs.gnu.org Subject: merge 337 28852 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) merge 337 28852 quit From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 17 16:00:44 2018 Received: (at control) by debbugs.gnu.org; 17 Jul 2018 20:00:44 +0000 Received: from localhost ([127.0.0.1]:45738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ffW9M-0005fm-2U for submit@debbugs.gnu.org; Tue, 17 Jul 2018 16:00:44 -0400 Received: from sinyavsky.aurox.ch ([37.35.109.145]:35311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ffW9K-0005fW-Ig for control@debbugs.gnu.org; Tue, 17 Jul 2018 16:00:43 -0400 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 9E82C227D8 for ; Tue, 17 Jul 2018 20:03:22 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= subject:subject:to:from:from:message-id:date:date; s=dkim; t= 1531857801; x=1532721802; bh=zykzNPlUc0WkXdFRnLdp6uyM3++MNN67PgE BJiNL/AE=; b=Vey5mkSyBXEapad8E8QLpH4LlFfRomxRx8+pUqSM+2l3eF205cA T5GMQwTzgXpBsL728Zt0zwPbROhTYR0CQWUhH1QDVctrC1yv3dK8D7QNFosOnrE3 8LM1+YLMwGgnPZeTGiCC4mk2f2Xj1+HNRVghjYV9I0Q64n7FjvcZ2ExI= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id N0scQY_XmdEf for ; Tue, 17 Jul 2018 20:03:21 +0000 (UTC) Received: from gray (65.104.198.178.dynamic.wline.res.cust.swisscom.ch [178.198.104.65]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 7A3B2227BD for ; Tue, 17 Jul 2018 20:03:21 +0000 (UTC) Date: Tue, 17 Jul 2018 22:09:07 +0200 Message-Id: From: charles@aurox.ch (Charles A. Roelli) To: control@debbugs.gnu.org Subject: unmerge X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) unmerge 28852 # I had merged 337 and 28852, but on second thoughts, # they are actually different requests. (The former is # about going from a source file position to the position # of the corresponding diff that changes the source file # position, while the second is about keeping approx. the # same position of point when typing "g" in *vc-diff*.) From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 24 13:41:06 2019 Received: (at 28852) by debbugs.gnu.org; 24 Jun 2019 17:41:06 +0000 Received: from localhost ([127.0.0.1]:57912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSxk-0006du-M9 for submit@debbugs.gnu.org; Mon, 24 Jun 2019 13:41:06 -0400 Received: from quimby.gnus.org ([80.91.231.51]:34060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSxi-0006di-P2 for 28852@debbugs.gnu.org; Mon, 24 Jun 2019 13:41:03 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfSxe-0005zJ-0v; Mon, 24 Jun 2019 19:41:00 +0200 From: Lars Ingebrigtsen To: charles@aurox.ch (Charles A. Roelli) Subject: Re: bug#28852: make revert-buffer ('g') in VC diff buffers keep point References: Date: Mon, 24 Jun 2019 19:40:57 +0200 In-Reply-To: (Charles A. Roelli's message of "Tue, 17 Oct 2017 19:58:00 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: charles@aurox.ch (Charles A. Roelli) writes: >> At the moment, when you hit 'g' in a *vc-diff* buffer, the cursor is >> moved back to (point-min), which can be annoying. Yes, I agree. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 28852 Cc: 28852@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) charles@aurox.ch (Charles A. Roelli) writes: >> At the moment, when you hit 'g' in a *vc-diff* buffer, the cursor is >> moved back to (point-min), which can be annoying. Yes, I agree. > +(defun vc-diff-restore-buffer (original new) > + "Restore point in buffer NEW to where it was in ORIGINAL. > + > +This function works by updating buffer ORIGINAL with the contents > +of NEW (without destroying existing markers), swapping their text > +objects, and finally killing buffer ORIGINAL." > + (with-current-buffer original > + (let ((inhibit-read-only t)) > + (replace-buffer-contents new))) > + (with-current-buffer new > + (buffer-swap-text original)) > + (kill-buffer original)) This will restore point to the same point it was before... but not to "where it was", necessarily, I think? That is, if your point is at character 105, then it'll be on character 105 after this, but since the contents may (and will) change, what's on character 105 may be totally different after running the diff -- new changes will appear and others will disappear. I remember discussing a "sloppy save excursion" on emacs-devel once: Save as much data as possible about the old buffer contents, and then try to move point to a similar context in the new buffer contents, even if that means moving to a different line. This is a general problem in many buffers that display generated content and need to get back to "where it was" after a `g'. But I can't remember what the conclusion was, and now I can't find the discussion... Does anybody remember? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 27 14:07:34 2019 Received: (at control) by debbugs.gnu.org; 27 Jun 2019 18:07:34 +0000 Received: from localhost ([127.0.0.1]:39592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgYo2-000784-HW for submit@debbugs.gnu.org; Thu, 27 Jun 2019 14:07:34 -0400 Received: from quimby.gnus.org ([80.91.231.51]:46604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgYo1-00077w-Eg for control@debbugs.gnu.org; Thu, 27 Jun 2019 14:07:33 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgYny-0000EW-IJ for control@debbugs.gnu.org; Thu, 27 Jun 2019 20:07:32 +0200 Date: Thu, 27 Jun 2019 20:07:30 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #28852 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: merge 28852 337 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) merge 28852 337 quit From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 23 07:47:53 2019 Received: (at control) by debbugs.gnu.org; 23 Nov 2019 12:47:53 +0000 Received: from localhost ([127.0.0.1]:55900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYUpN-00064j-3B for submit@debbugs.gnu.org; Sat, 23 Nov 2019 07:47:53 -0500 Received: from quimby.gnus.org ([95.216.78.240]:35494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYUpH-00064M-15 for control@debbugs.gnu.org; Sat, 23 Nov 2019 07:47:49 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iYUp8-0005La-Mz for control@debbugs.gnu.org; Sat, 23 Nov 2019 13:47:40 +0100 Date: Sat, 23 Nov 2019 13:47:38 +0100 Message-Id: <877e3qpxn9.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #337 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 337 - patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 337 - patch quit From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 10:48:53 2022 Received: (at 28852) by debbugs.gnu.org; 29 Jan 2022 15:48:53 +0000 Received: from localhost ([127.0.0.1]:34518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDpy9-0000jb-GD for submit@debbugs.gnu.org; Sat, 29 Jan 2022 10:48:53 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDpy7-0000jJ-Vo for 28852@debbugs.gnu.org; Sat, 29 Jan 2022 10:48:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2FcdjaNYGlNM6xbKULgyI6H3no5aqmW238mCO0Hlr1Y=; b=QmyKTye/OHK5C6gcceC/E4skLv nHv7tMEcXIS5d5gRHdLE7ohIpJB9C6mHDK0kcYs51yiQ7r0b5nPaKjlCik59N74RBfQhCtM9OW44S cJH460Ltoy5+MGmuBJzHQousM5JXeCYS4WgXHNjY2iDZvkhRtZvYRAmXJkXIgbHUJsNY=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDpxy-0004CH-UR; Sat, 29 Jan 2022 16:48:45 +0100 From: Lars Ingebrigtsen To: charles@aurox.ch (Charles A. Roelli) Subject: Re: bug#28852: make revert-buffer ('g') in VC diff buffers keep point References: X-Now-Playing: The Durutti Column's _Circuses and Bread_: "Black Horses" Date: Sat, 29 Jan 2022 16:48:40 +0100 In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 24 Jun 2019 19:40:57 +0200") Message-ID: <87tudm8rvr.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > This will restore point to the same point it was before... but not to > "where it was", necessarily, I think? I was confused about how these functions worked. I've respun the patch for Emacs 29, and it seem to work very well, so I've now pushed it. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28852 Cc: 28852@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > This will restore point to the same point it was before... but not to > "where it was", necessarily, I think? I was confused about how these functions worked. I've respun the patch for Emacs 29, and it seem to work very well, so I've now pushed it. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 10:49:02 2022 Received: (at control) by debbugs.gnu.org; 29 Jan 2022 15:49:02 +0000 Received: from localhost ([127.0.0.1]:34521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDpyE-0000js-NV for submit@debbugs.gnu.org; Sat, 29 Jan 2022 10:49:02 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDpyD-0000jS-SD for control@debbugs.gnu.org; Sat, 29 Jan 2022 10:48:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=RgteBwLdWHzthMEgIdts+7klIfi4HBEd3Yp7yJj7t8o=; b=MpgbZbp0hHIuyhPyHKvrdiLgzU BcKIxpgwrMRiZ9TVAvoVW/v+m5brY9UdkUn02Idi6Fx+wMrtxXKlKxLPH8Hj6cLdpFqgXU1cBXJr2 ZgyWurhjYPvOXrfAM/uTZyFiQXaoOZO39JHTErxqi6IV9ADROeb70rLxMA/xq2IT5n8s=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDpy5-0004CV-VP for control@debbugs.gnu.org; Sat, 29 Jan 2022 16:48:52 +0100 Date: Sat, 29 Jan 2022 16:48:49 +0100 Message-Id: <87sft68rvi.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #28852 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 28852 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 28852 29.1 quit From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 13:54:51 2022 Received: (at 28852) by debbugs.gnu.org; 29 Jan 2022 18:54:51 +0000 Received: from localhost ([127.0.0.1]:34810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDss6-0004pX-RT for submit@debbugs.gnu.org; Sat, 29 Jan 2022 13:54:51 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:39903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDss5-0004pE-59 for 28852@debbugs.gnu.org; Sat, 29 Jan 2022 13:54:49 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id AA36E1BF204; Sat, 29 Jan 2022 18:54:41 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#28852: make revert-buffer ('g') in VC diff buffers keep point Organization: LINKOV.NET References: <87tudm8rvr.fsf@gnus.org> Date: Sat, 29 Jan 2022 20:48:36 +0200 In-Reply-To: <87tudm8rvr.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 29 Jan 2022 16:48:40 +0100") Message-ID: <86mtjepizv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28852 Cc: 28852@debbugs.gnu.org, "Charles A. Roelli" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> This will restore point to the same point it was before... but not to >> "where it was", necessarily, I think? > > I was confused about how these functions worked. I've respun the patch > for Emacs 29, and it seem to work very well, so I've now pushed it. This doesn't work with such customization: (add-hook 'diff-mode-hook 'rename-uniquely) because this change assumes that the current buffer is always "*vc-diff*" whereas the reverted buffer can be "*vc-diff*<2>". Isn't the reverted buffer always current during revert-buffer command? If this assumption is correct, how about his fix? diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0096a5fcb3..1671f2f860 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1798,10 +1798,9 @@ vc-diff-internal (coding-system-for-read (if files (vc-coding-system-for-diff (car files)) 'undecided)) (orig-diff-buffer-clone - (if (and (get-buffer buffer) revert-buffer-in-progress-p) - (with-current-buffer buffer - (clone-buffer - (generate-new-buffer-name " *vc-diff-clone*") nil))))) + (if revert-buffer-in-progress-p + (clone-buffer + (generate-new-buffer-name " *vc-diff-clone*") nil)))) ;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style ;; EOLs, which will look ugly if (car files) happens to have Unix ;; EOLs. -- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 30 10:55:22 2022 Received: (at 28852) by debbugs.gnu.org; 30 Jan 2022 15:55:22 +0000 Received: from localhost ([127.0.0.1]:37391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nECXy-000898-9t for submit@debbugs.gnu.org; Sun, 30 Jan 2022 10:55:22 -0500 Received: from quimby.gnus.org ([95.216.78.240]:35886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nECXw-00088u-2y for 28852@debbugs.gnu.org; Sun, 30 Jan 2022 10:55:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NCYy9PMuu3mG8g6AenkYK8F5DbnebW1zB2J5axmDAIk=; b=KLNErSDTauoQY3VOoHvBXdnkH1 KoiMVarBrSMlfAGPzlCy8CjumQCWe5gAkMc8s51bAPiKRnCe0jsYAZ1WwKSWR3nH8UDx0Vp8xQ5a7 6/taaeDAFEVO7QwMCeDUvQWqkYf3P3sysT4fAwDrtux0DigEP9B+ajoXPAkv8O7z0h5o=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nECXn-0007oM-9S; Sun, 30 Jan 2022 16:55:13 +0100 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#28852: make revert-buffer ('g') in VC diff buffers keep point References: <87tudm8rvr.fsf@gnus.org> <86mtjepizv.fsf@mail.linkov.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXn6NJYRzsTEBSc bFr///+Q5a+sAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+YBHg8pAiB74tkAAAF1SURBVDjLbZPZgYUw CEXjpAGBBh6xgRD6722ArL4ZflROWALXlIYhFjcmTW8r2/g+/Lmwh3BHB7kK4A45In4KuAe/AwYY Vs/a3EE8AtRR+yhxglYganS8gNpnAOQT5PhwMNMFUC3R0AC42rXELAOs+kw1EcACdDArzDMVEu5r JgDAWcMAHUBPcM+YxAwwACsh6TVAwQ4sTJWF80xlZ/v8AEStRFvApsAxJmiKN862UszNuwcqFXUu d4BIpZZ/z35HUDYAcgCIYfPTnuvRdoLeL7FeH97ArwEmQxCidt8HsLIPSrEpq/jLugdyY78F4bOO B4Chm7uRFN0gSvR95pqub2Do48KQNwC/yKeGvt7Al0EuyL8AwDWT8R9QtUvyG2i2kPo3lVRJWetq lydQpeQ7n/66UtGTVYbabdSaQGQFIZr4ArEm0hmDY2Xh190ukExg/hdQGBrx9w2QbJGxAt82HRH+ I/S/zpLSu8bQqtsBHsGRx0/9ArM5c6JvYejJAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTAxLTMw VDE1OjQxOjAyKzAwOjAw7hAvXgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wMS0zMFQxNTo0MTow MiswMDowMJ9Nl+IAAAAASUVORK5CYII= X-Now-Playing: Ida's _Ten Small Paces_: "Blue Moon of Livonia" Date: Sun, 30 Jan 2022 16:55:10 +0100 In-Reply-To: <86mtjepizv.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 29 Jan 2022 20:48:36 +0200") Message-ID: <87k0ehb4m9.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > Isn't the reverted buffer always current during revert-buffer command? Yes, I think so. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28852 Cc: 28852@debbugs.gnu.org, "Charles A. Roelli" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: > Isn't the reverted buffer always current during revert-buffer command? Yes, I think so. > If this assumption is correct, how about his fix? Makes sense to me. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Tue Jun 17 20:39:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 28 Feb 2022 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator