From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#33319: Support revisions in diff-goto-source Date: Fri, 09 Nov 2018 09:52:22 +0200 Message-ID: <83pnvebscp.fsf@gnu.org> References: <87lg63p9fd.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1541749879 12618 195.159.176.226 (9 Nov 2018 07:51:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Nov 2018 07:51:19 +0000 (UTC) Cc: 33319@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 09 08:51:15 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gL1ZR-00036u-8t for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Nov 2018 08:51:13 +0100 Original-Received: from localhost ([::1]:60771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL1bX-0000eE-Gk for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Nov 2018 02:53:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL1bI-0000bj-75 for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2018 02:53:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gL1bE-0008P2-Vd for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2018 02:53:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37910) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gL1bB-0008LL-PJ for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2018 02:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gL1bB-0000sp-L5 for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2018 02:53:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Nov 2018 07:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33319 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 33319-submit@debbugs.gnu.org id=B33319.15417499773385 (code B ref 33319); Fri, 09 Nov 2018 07:53:01 +0000 Original-Received: (at 33319) by debbugs.gnu.org; 9 Nov 2018 07:52:57 +0000 Original-Received: from localhost ([127.0.0.1]:42168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gL1b6-0000sX-It for submit@debbugs.gnu.org; Fri, 09 Nov 2018 02:52:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gL1b4-0000sJ-Lj for 33319@debbugs.gnu.org; Fri, 09 Nov 2018 02:52:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gL1av-0007pG-48 for 33319@debbugs.gnu.org; Fri, 09 Nov 2018 02:52:48 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL1ao-0007f0-Qa; Fri, 09 Nov 2018 02:52:40 -0500 Original-Received: from [176.228.60.248] (port=4493 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gL1an-0005UI-GC; Fri, 09 Nov 2018 02:52:38 -0500 In-reply-to: <87lg63p9fd.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 08 Nov 2018 23:05:10 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152195 Archived-At: > From: Juri Linkov > Date: Thu, 08 Nov 2018 23:05:10 +0200 > > So the proposed feature is backward-compatible: in the diff buffer > created by a version control system, with a prefix arg it will jump > to an old revision of the file. > > It is very useful to look at the context of changed lines > of the file as it was at the time of that old revision. Thanks. > diff --git a/etc/NEWS b/etc/NEWS > index 1020a2a0ea..36ad3d82df 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -353,6 +353,11 @@ To disable it, set the new defcustom 'diff-font-lock-refine' to nil. > *** File headers can be shortened, mimicking Magit's diff format. > To enable it, set the new defcustom 'diff-font-lock-prettify to t. > > +*** In the diff buffer created by a version control system, the prefix > +arg of diff-goto-source means it jumps to the old revision of the file ^^^^^^^^^^^^^^^^^ "... means jump to ..." is a better wording, I think. Also, it is best to provide a header for the description of the change, so that it could be meaningfully folded by Outline mode. And I think we want to update the manual as well. > +(defvar diff-vc-revisions nil > + "The VC revisions compared in the current Diff buffer, if any.") > + > (defvar diff-outline-regexp > "\\([*+][*+][*+] [^0-9]\\|@@ ...\\|\\*\\*\\* [0-9].\\|--- [0-9]..\\)") Which VCSes does this support? I'm not sure all of them produce such markers. If this supports only some, we should document that and make sure the code does something reasonable when the revision is not found.