all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@gnu.org>
Subject: patch: vc.el annotation prev/next "in place"
Date: 05 Apr 2006 17:15:04 -0400	[thread overview]
Message-ID: <jku097lo6f.fsf@glug.org> (raw)

i month or so ago, i complained about the P and N (and J) commands in
vc-annotate buffer ending up (selecting) another buffer/window.  the
following patch reverts the old behavior, according to my tastes, but
i suspect there is a better way, by avoiding `switch-to-buffer', for
example.  what do you think?

thi

______________________________
Index: vc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc.el,v
retrieving revision 1.414
diff -w -b -B -c -r1.414 vc.el
*** vc.el	7 Feb 2006 16:59:01 -0000	1.414
--- vc.el	5 Apr 2006 21:05:34 -0000
***************
*** 3076,3083 ****
  				  nil nil "20")))))))
    (vc-ensure-vc-buffer)
    (setq vc-annotate-display-mode display-mode) ;Not sure why.  --Stef
!   (let* ((temp-buffer-name (format "*Annotate %s (rev %s)*" (buffer-name) rev))
!          (temp-buffer-show-function 'vc-annotate-display-select))
      (message "Annotating...")
      ;; If BUF is specified it tells in which buffer we should put the
      ;; annotations.  This is used when switching annotations to another
--- 3076,3087 ----
  				  nil nil "20")))))))
    (vc-ensure-vc-buffer)
    (setq vc-annotate-display-mode display-mode) ;Not sure why.  --Stef
!   (let* ((temp-buffer-setup-hook nil)
!          (temp-buffer-name (format "*Annotate %s (rev %s)*"
!                                    (buffer-name) rev))
!          (temp-buffer-show-function (lambda (buf)
!                                       (switch-to-buffer buf)
!                                       (vc-annotate-display-select))))
      (message "Annotating...")
      ;; If BUF is specified it tells in which buffer we should put the
      ;; annotations.  This is used when switching annotations to another
***************
*** 3086,3101 ****
  	      (rename-buffer temp-buffer-name t)
  	      ;; In case it had to be uniquified.
  	      (setq temp-buffer-name (buffer-name))))
!     (with-output-to-temp-buffer temp-buffer-name
!       (vc-call annotate-command file (get-buffer temp-buffer-name) rev))
      (with-current-buffer temp-buffer-name
        (set (make-local-variable 'vc-annotate-backend) (vc-backend file))
        (set (make-local-variable 'vc-annotate-parent-file) file)
        (set (make-local-variable 'vc-annotate-parent-rev) rev)
        (set (make-local-variable 'vc-annotate-parent-display-mode)
! 	   display-mode))
  
!   (message "Annotating... done")))
  
  (defun vc-annotate-prev-version (prefix)
    "Visit the annotation of the version previous to this one.
--- 3090,3108 ----
                (rename-buffer temp-buffer-name t)
                ;; In case it had to be uniquified.
                (setq temp-buffer-name (buffer-name))))
!     (vc-call annotate-command file (get-buffer-create temp-buffer-name) rev)
!     (switch-to-buffer temp-buffer-name)
!     (delete-other-windows)
!     (vc-annotate-display-select)
!     (goto-char (point-min))
      (with-current-buffer temp-buffer-name
        (set (make-local-variable 'vc-annotate-backend) (vc-backend file))
        (set (make-local-variable 'vc-annotate-parent-file) file)
        (set (make-local-variable 'vc-annotate-parent-rev) rev)
        (set (make-local-variable 'vc-annotate-parent-display-mode)
!            display-mode)))
  
!   (message "Annotating... done"))
  
  (defun vc-annotate-prev-version (prefix)
    "Visit the annotation of the version previous to this one.

             reply	other threads:[~2006-04-05 21:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-05 21:15 Thien-Thi Nguyen [this message]
2006-04-05 22:04 ` patch: vc.el annotation prev/next "in place" Stefan Monnier
2006-04-05 22:37 ` Kevin Rodgers
2006-04-11 20:29   ` Stefan Monnier
2006-04-13 16:07   ` Thien-Thi Nguyen
2006-04-13 16:26     ` Romain Francoise

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=jku097lo6f.fsf@glug.org \
    --to=ttn@gnu.org \
    /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.