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

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

bug#8366: wish: include vc-annotate-goto-line


From: Chong Yidong
Subject: bug#8366: wish: include vc-annotate-goto-line
Date: Sun, 24 Apr 2011 15:43:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Juanma Barranquero <lekktu@gmail.com> writes:

>> Juanma, feel free to install such a feature.
>
> Hmm, no. It's just half-cooked; I threw it together in a few minutes
> to help the OP.
>
>> Annotate buffer may display a different version that the one of the
>> checked out file.  E.g. because you have local uncommitted changes, or
>> because you asked for the annotations of an older revision.  So line
>> numbers may not fully match.  In general, there's no much we can do
>> about it, but we should probably try a bit harder than the above,
>> e.g. by looking for the closest line with the same text as the line
>> we're looking for.  Better would be to ask for a diff between the
>> annotated revision and the current file and use it to find out the
>> line-offset to use (for those cases where this method works).
>
> Even if the buffer contains the same version, there's the matter of
> visual-line-mode, truncate-lines, etc. which can affect line count. So
> yes, for a robust answer looking at the context seems essential.

A non-robust implementation is better than nothing, so I committed the
command to the trunk, starting from your version, and revising it to use
vc-parent-buffer and emitting warning messages if the parent file/buffer
is modified or out of date.

As for the "look for the closest line with the same text" functionality,
my feeling is that this is a mug's game when version control is
involved.  If you or anyone else wants to take a stab at it, feel free.





reply via email to

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