emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: limit the number of log entries displayed by C-x v l


From: Dan Nicolaescu
Subject: Re: limit the number of log entries displayed by C-x v l
Date: Mon, 16 Nov 2009 01:40:40 -0800 (PST)

Dan Nicolaescu <address@hidden> writes:

  > I'll work on adding button(s) to request more entries.

Here's how this can be done.  OK?

Index: vc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v
retrieving revision 1.739
diff -u -3 -p -r1.739 vc.el
--- vc.el       15 Nov 2009 20:29:02 -0000      1.739
+++ vc.el       16 Nov 2009 09:34:00 -0000
@@ -1858,6 +1858,10 @@ Not all VC backends support short logs!"
          (not (null (if dir-present
                         (memq 'directory vc-log-short-style)
                       (memq 'file vc-log-short-style)))))
+
+    ;; Some backends cannot support output limits.
+    (when (memq backend '(RCS CVS SCCS)) (setq limit nil))
+
     (vc-call-backend backend 'print-log files "*vc-change-log*" vc-short-log 
limit)
     (pop-to-buffer "*vc-change-log*")
     (vc-exec-after
@@ -1867,6 +1871,23 @@ Not all VC backends support short logs!"
        (set (make-local-variable 'log-view-vc-backend) ',backend)
        (set (make-local-variable 'log-view-vc-fileset) ',files)
 
+       (when ,limit
+         (goto-char (point-max))
+         (widget-create 'push-button
+                        :notify (lambda (&rest ignore)
+                                  (vc-print-log-internal
+                                   ',backend ',files ',working-revision (* 2 
,limit)))
+                        :help-echo "Show the log again, and double the number 
of log entries shown"
+                        "Show 2X entries")
+         (widget-insert "    ")
+         (widget-create 'push-button
+                        :notify (lambda (&rest ignore)
+                                  (vc-print-log-internal
+                                   ',backend ',files ',working-revision nil))
+                        :help-echo "Show the log again, showing all entries"
+                        "Show unlimited entries")
+         (widget-setup))
+
        (shrink-window-if-larger-than-buffer)
        ;; move point to the log entry for the working revision
        (vc-call-backend ',backend 'show-log-entry ',working-revision)
Index: log-view.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/log-view.el,v
retrieving revision 1.61
diff -u -3 -p -r1.61 log-view.el
--- log-view.el 5 Oct 2009 15:10:04 -0000       1.61
+++ log-view.el 16 Nov 2009 09:34:01 -0000
@@ -139,6 +139,7 @@
     ("\M-n" . log-view-file-next)
     ("\M-p" . log-view-file-prev))
   "Log-View's keymap."
+  :inherit widget-keymap
   :group 'log-view)
 
 (easy-menu-define log-view-mode-menu log-view-mode-map




reply via email to

[Prev in Thread] Current Thread [Next in Thread]