all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Uwe Brauer <oub@mat.ucm.es>
Cc: emacs-devel@gnu.org
Subject: Re: vc-annotate and jump to a specific line
Date: Fri, 25 Mar 2011 00:34:48 +0100	[thread overview]
Message-ID: <AANLkTik30ePWJ=J6nQwVfAxVxVwXd3wTO6KZGZaNqx3m@mail.gmail.com> (raw)
In-Reply-To: <87ei5wxrz1.fsf@mat.ucm.es>

On Thu, Mar 24, 2011 at 20:01, Uwe Brauer <oub@mat.ucm.es> 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)))))


    Juanma



  reply	other threads:[~2011-03-24 23:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 19:01 vc-annotate and jump to a specific line Uwe Brauer
2011-03-24 23:34 ` Juanma Barranquero [this message]
2011-03-25 11:43   ` Uwe Brauer
2011-03-25 11:52     ` Juanma Barranquero
2011-03-26 11:33       ` Uwe Brauer
2011-03-26 23:05         ` Juanma Barranquero
2011-03-27  9:28           ` Uwe Brauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTik30ePWJ=J6nQwVfAxVxVwXd3wTO6KZGZaNqx3m@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=oub@mat.ucm.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.