bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33319: Support revisions in diff-goto-source


From: Eli Zaretskii
Subject: bug#33319: Support revisions in diff-goto-source
Date: Fri, 09 Nov 2018 09:52:22 +0200

> From: Juri Linkov <juri@linkov.net>
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]