mirror of
https://github.com/m00natic/vlfi.git
synced 2025-02-24 05:48:06 +00:00
Add automatic batching when scrolling.
This commit is contained in:
parent
f1ade8106c
commit
3fb898e83a
19
vlfi.el
19
vlfi.el
@ -146,6 +146,25 @@ OP-TYPE specifies the file operation being performed over FILENAME."
|
|||||||
;;;###autoload
|
;;;###autoload
|
||||||
(fset 'abort-if-file-too-large 'vlfi-if-file-too-large)
|
(fset 'abort-if-file-too-large 'vlfi-if-file-too-large)
|
||||||
|
|
||||||
|
;; scroll auto batching
|
||||||
|
(defadvice scroll-up (around vlfi-scroll-up
|
||||||
|
activate compile)
|
||||||
|
"Slide to next batch if at end of buffer in `vlfi-mode'."
|
||||||
|
(if (and (eq major-mode 'vlfi-mode)
|
||||||
|
(eobp))
|
||||||
|
(progn (vlfi-next-batch 1)
|
||||||
|
(goto-char (point-min)))
|
||||||
|
ad-do-it))
|
||||||
|
|
||||||
|
(defadvice scroll-down (around vlfi-scroll-down
|
||||||
|
activate compile)
|
||||||
|
"Slide to previous batch if at beginning of buffer in `vlfi-mode'."
|
||||||
|
(if (and (eq major-mode 'vlfi-mode)
|
||||||
|
(bobp))
|
||||||
|
(progn (vlfi-prev-batch 1)
|
||||||
|
(goto-char (point-max)))
|
||||||
|
ad-do-it))
|
||||||
|
|
||||||
;; non recent Emacs
|
;; non recent Emacs
|
||||||
(unless (fboundp 'file-size-human-readable)
|
(unless (fboundp 'file-size-human-readable)
|
||||||
(defun file-size-human-readable (file-size)
|
(defun file-size-human-readable (file-size)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user