From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.devel Subject: Re: limit the number of log entries displayed by C-x v l Date: Sun, 22 Nov 2009 22:49:20 -0500 Message-ID: <19210.1600.43351.317882@rgr.rgrjr.com> References: <200911171344.nAHDis0c026133@godzilla.ics.uci.edu> <200911181819.nAIIJIUk009684@godzilla.ics.uci.edu> <873a4bc70c.fsf@tux.homenetwork> <200911200659.nAK6xpkt020046@godzilla.ics.uci.edu> <200911201526.nAKFQV2m023996@godzilla.ics.uci.edu> <87fx8833jy.fsf@uwakimon.sk.tsukuba.ac.jp> <20091122230226.GA3519@headley> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1258948186 20590 80.91.229.12 (23 Nov 2009 03:49:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Nov 2009 03:49:46 +0000 (UTC) Cc: "Stephen J. Turnbull" , Dan Nicolaescu , emacs-devel@gnu.org, Thierry Volpiatto To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 23 04:49:38 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NCPvl-0003A4-FC for ged-emacs-devel@m.gmane.org; Mon, 23 Nov 2009 04:49:37 +0100 Original-Received: from localhost ([127.0.0.1]:55916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCPvk-0001vy-Gn for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2009 22:49:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCPvd-0001tq-TU for emacs-devel@gnu.org; Sun, 22 Nov 2009 22:49:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCPvY-0001t6-4p for emacs-devel@gnu.org; Sun, 22 Nov 2009 22:49:28 -0500 Original-Received: from [199.232.76.173] (port=58356 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCPvY-0001t3-09 for emacs-devel@gnu.org; Sun, 22 Nov 2009 22:49:24 -0500 Original-Received: from rgrjr.com ([216.146.47.5]:55887) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCPvX-0001Vi-IB for emacs-devel@gnu.org; Sun, 22 Nov 2009 22:49:23 -0500 Original-Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net [66.30.196.77]) by rgrjr.com (Postfix on CentOS) with ESMTP id 2C943160197 for ; Mon, 23 Nov 2009 03:49:22 +0000 (UTC) Original-Received: (qmail 30517 invoked by uid 89); 23 Nov 2009 03:49:21 -0000 Original-Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 23 Nov 2009 03:49:21 -0000 Original-Received: by rgr.rgrjr.com (Postfix, from userid 500) id 49B32484BE; Sun, 22 Nov 2009 22:49:20 -0500 (EST) In-Reply-To: X-Mailer: VM viewmail-600 under 23.1.50.1 (i686-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:117552 Archived-At: From: Stefan Monnier 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)