unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Stephen J. Turnbull" <stephen@xemacs.org>,
	Dan Nicolaescu <dann@ics.uci.edu>,
	emacs-devel@gnu.org,
	Thierry Volpiatto <thierry.volpiatto@gmail.com>
Subject: Re: limit the number of log entries displayed by C-x v l
Date: Sun, 22 Nov 2009 22:49:20 -0500	[thread overview]
Message-ID: <19210.1600.43351.317882@rgr.rgrjr.com> (raw)
In-Reply-To: <jwviqd23rg9.fsf-monnier+emacs@gnu.org>

   From: Stefan Monnier <monnier@iro.umontreal.ca>
   Date: Sun, 22 Nov 2009 21:29:15 -0500

   >> They can't even do "log+diff", and some of the main contributors have
   >> already seen this suggestion back when I asked for it for Arch.
   >> Nobody's ever seemed to understand how useful it would be.

   > Bzr does have `log -p' (as does Git and Hg of course), which shows the
   > log and diff at the same time.

   Thanks for proving me wrong. ;-)
   So maybe there is hope for the feature of which I've been dreaming.

	   Stefan

Here's a non-backend-specific hack for C-n and C-p in vc-annotate-mode
that keeps any log-view-mode buffer displayed on the same frame in sync
to the same revision.  A post-command-hook solution might be more
thorough, though (handling C-s, e.g.), but is this in the direction of
what you had in mind?

					-- Bob Rogers
					   http://www.rgrjr.com/

------------------------------------------------------------------------
(defun vc-annotate-find-visible-log-buffer-window
       (file &optional start-window last-window)
  ;; Look for a window on the current frame that contains a
  ;; log-view-mode buffer that is looking at file.
  (or start-window (setq start-window (selected-window)
			 last-window start-window))
  (let ((window (next-window last-window)))
    (if (not (eq window start-window))
	;; See if window contains a log buffer.
	(or (save-excursion
	      (set-buffer (window-buffer window))
	      (and (eq major-mode 'log-view-mode)
		   (condition-case ()
		       ;; This shouldn't fail in a log-view-mode
		       ;; buffer, but just in case.
		       (equal (log-view-current-file) file)
		     (error nil))
		   window))
	    (vc-annotate-find-visible-log-buffer-window file start-window
							window)))))

(defun vc-annotate-next-line (&optional arg)
  "Next line in an annotation buffer, keeping any visible log in sync."
  (interactive "^p")
  (line-move-1 (or arg 1))
  (if (not (equal major-mode 'vc-annotate-mode))
      (error "Cannot be invoked outside of a vc annotate buffer."))
  (let* ((backend vc-annotate-backend)
	 (rev-at-line (vc-annotate-extract-revision-at-line))
	 (revision (car rev-at-line))
	 (file (cdr rev-at-line))
	 (log-buffer-window
	   (and rev-at-line
		(vc-annotate-find-visible-log-buffer-window file))))
    (if log-buffer-window
	(let ((original-window (selected-window)))
	  (select-window log-buffer-window)
	  (vc-call-backend backend 'show-log-entry revision)
	  (select-window original-window)))))

(defun vc-annotate-previous-line (&optional arg)
  "Previous line in an annotation buffer, keeping any visible log in sync."
  (interactive "^p")
  (vc-annotate-next-line (- (or arg 1))))

(define-key vc-annotate-mode-map "\C-n" 'vc-annotate-next-line)
(define-key vc-annotate-mode-map "\C-p" 'vc-annotate-previous-line)




  reply	other threads:[~2009-11-23  3:49 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12 23:19 limit the number of log entries displayed by C-x v l Dan Nicolaescu
2009-11-13  1:18 ` Stefan Monnier
2009-11-13  2:21   ` Dan Nicolaescu
2009-11-13  3:19     ` Stefan Monnier
2009-11-13  5:02       ` Dan Nicolaescu
2009-11-13 14:10         ` Stefan Monnier
2009-11-15 20:55           ` Dan Nicolaescu
2009-11-15 21:34             ` Chong Yidong
2009-11-16  9:40             ` Dan Nicolaescu
2009-11-16 14:22               ` Stefan Monnier
2009-11-16 15:10                 ` Dan Nicolaescu
2009-11-16 15:41                   ` Stefan Monnier
2009-11-16 20:40                     ` Dan Nicolaescu
2009-11-17 13:44           ` Dan Nicolaescu
2009-11-17 19:54             ` Stefan Monnier
2009-11-18 18:19               ` Dan Nicolaescu
2009-11-19  0:52                 ` Stefan Monnier
2009-11-19  7:23                   ` Thierry Volpiatto
2009-11-20  6:59                     ` Dan Nicolaescu
2009-11-20  7:19                       ` Thierry Volpiatto
2009-11-20 14:11                       ` Stefan Monnier
2009-11-20 15:26                         ` Dan Nicolaescu
2009-11-21  4:27                           ` Stephen J. Turnbull
2009-11-22 20:12                             ` Stefan Monnier
2009-11-22 23:02                               ` Štěpán Němec
2009-11-23  2:29                                 ` Stefan Monnier
2009-11-23  3:49                                   ` Bob Rogers [this message]
2009-11-23  5:17                                     ` Stefan Monnier
2009-11-22 20:10                           ` Stefan Monnier
2009-12-06 17:43                   ` Dan Nicolaescu
2009-12-07  2:12                     ` Stefan Monnier
2009-11-13  6:59     ` Giorgos Keramidas
2009-11-14 10:10 ` Alfred M. Szmidt
2009-11-14 23:29   ` Richard Stallman
2009-11-14 23:34     ` Andreas Schwab
2009-11-15 22:38       ` Richard Stallman
2009-11-15 22:52         ` Andreas Schwab
2009-11-17  7:56           ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=19210.1600.43351.317882@rgr.rgrjr.com \
    --to=rogers-emacs@rgrjr.dyndns.org \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stephen@xemacs.org \
    --cc=thierry.volpiatto@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).