[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vc-annotate and jump to a specific line
From: |
Uwe Brauer |
Subject: |
Re: vc-annotate and jump to a specific line |
Date: |
Fri, 25 Mar 2011 12:43:13 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) XEmacs/21.4.21 (linux) |
>> Regarding Re: vc-annotate and jump to a specific line; Juanma Barranquero
>> <address@hidden> adds:
> On Thu, Mar 24, 2011 at 20:01, Uwe Brauer <address@hidden> wrote:
>> Anybody know about such a function?
> Something like that (warning: barely tested)
> (defun vc-annotate-goto-line ()
> (interactive)
> (unless (eq major-mode 'vc-annotate-mode)
> (error "vc-annotate-goto-line must be used on a VC-Annotate buffer"))
> (let* ((name (buffer-name))
> (base (and (string-match "Annotate \\(.*\\) (rev" name)
> (match-string 1 name)))
> (line (save-restriction
> (widen)
> (line-number-at-pos))))
> (with-current-buffer (get-buffer base)
> (pop-to-buffer (current-buffer))
> (save-restriction
> (widen)
> (goto-char (point-min))
> (forward-line (1- line))
> (recenter)))))
Right from a practical point this is what I am looking for,
thanks a lot. It does not jump precisely to the line, but as
close as 4 lines.
Look at this example
VC-annote buffer
2010-03-06 1.7 : \end{itemize}
2010-03-06 1.7 : \end{frame}
2011-03-01 1.10:
2010-03-06 1.7 : \begin{frame}
2010-03-02 1.1 :
2011-03-01 1.10: \only<article>{ Si intentamos conseguir que el} Error
Global de
2011-03-01 1.10: Discretización sea del mismo orden que el Error Local de
2011-03-01 1.10: Truncamiento, \only<article>{está claro que} necesitamos que
2011-03-01 1.10: $|x_{0}-a|=O(h^{2})$ y $|x_{1}-x(t_{1})|=O(h^{2})$ en cuyo
caso
Cursor is on 1.10 \only<article>{ Si intentamos conseguir que el}
Your functions jumps to line starting with
\end{itemize}
As I said the difference of these for lines are not
important I was just wondering ...
Thanks again.
Uwe