Óscar Fuentes <[email protected]> writes: > 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)))
It would be much better if both function, and magit-log-infinite-length, would be define globally. Remark that local-set-key do not do what you seem to believe it is doing: it change the local-map. In the log buffer it is magit-mode-map, the map used in status, log and commit buffer. If you want to change it, change it in the centralized point. -- Rémi Vanicat -- To unsubscribe, reply using "remove me" as the subject.
