This adds two keybindings for increasing the number of log entries shown
on a log buffer. It adds text at the end of the buffer announcing the
feature.


diff --git a/magit.el b/magit.el
index 59430cd..a83e3b7 100644
--- a/magit.el
+++ b/magit.el
@@ -3223,7 +3223,31 @@ Prefix arg means justify as well."
             ,@(if magit-have-decorate (list "--decorate=full"))
             ,@(if magit-have-graph (list "--graph"))
             ,@args
-            "--"))))
+            "--")))
+  (make-local-variable 'magit-log-cutoff-length)
+  (let ((inhibit-read-only t))
+    (lexical-let
+     ((magit-log-infinite-length 100000000)
+      (range range) (style style) (args args))
+     (when (/= magit-log-cutoff-length magit-log-infinite-length)
+       (goto-char (point-max))
+       (insert (format "\nShowing a maximum of %d log entries."
+                      magit-log-cutoff-length))
+       (insert "\n\nPress `C-d' for doubling the number of log entries shown.")
+       (insert "\nPress `C-M-d' for showing all the log entries.")
+       (local-set-key "\C-d"
+                     (lambda (&rest ignore)
+                       (interactive)
+                       (setq magit-log-cutoff-length
+                             (* 2 magit-log-cutoff-length))
+                       (magit-refresh-log-buffer range style args)))
+       (local-set-key "\C-\M-d"
+                     (lambda (&rest ignore)
+                       (interactive)
+                       (setq magit-log-cutoff-length magit-log-infinite-length)
+                       (magit-refresh-log-buffer range style args)))))
+    (set-buffer-modified-p nil)))
+
 
 (defun magit-log (&optional arg)
   (interactive "P")




-- 
To unsubscribe, reply using "remove me" as the subject.

Reply via email to