mirror of
https://github.com/m00natic/vlfi.git
synced 2025-01-18 20:10:47 +00:00
Revert to showing batch size in buffer name instead of the mode-line.
This commit is contained in:
parent
2ac3e7d577
commit
177c680288
12
README.org
12
README.org
@ -62,8 +62,8 @@ respectively.
|
|||||||
|
|
||||||
*C-c C-v j* jumps to given chunk. To see where you are in file and
|
*C-c C-v j* jumps to given chunk. To see where you are in file and
|
||||||
how many chunks there are (using the current batch size), look at the
|
how many chunks there are (using the current batch size), look at the
|
||||||
bracketed part of the buffer name, batch size is indicated in the
|
parenthesized part of the buffer name, batch size is also indicated at
|
||||||
mode-line.
|
the end.
|
||||||
|
|
||||||
** Search whole file
|
** Search whole file
|
||||||
|
|
||||||
@ -74,10 +74,10 @@ beforehand.
|
|||||||
|
|
||||||
** Occur over whole file
|
** Occur over whole file
|
||||||
|
|
||||||
*C-c C-v o* builds index for given regular expression just like M-x
|
*C-c C-v o* builds index for given regular expression just like
|
||||||
occur*. It does this batch by batch over the whole file. Note that
|
*M-x occur*. It does this batch by batch over the whole file. Note
|
||||||
even if you prematurely stop it with *C-g*, it will still show index
|
that even if you prematurely stop it with *C-g*, it will still show
|
||||||
of what's found so far.
|
index of what's found so far.
|
||||||
|
|
||||||
** Jump to line
|
** Jump to line
|
||||||
|
|
||||||
|
24
vlf.el
24
vlf.el
@ -209,24 +209,14 @@ with the prefix argument DECREASE it is halved."
|
|||||||
(* vlf-batch-size 2)))
|
(* vlf-batch-size 2)))
|
||||||
(vlf-move-to-batch vlf-start-pos))
|
(vlf-move-to-batch vlf-start-pos))
|
||||||
|
|
||||||
(defun vlf-format-buffer-name ()
|
|
||||||
"Return format for vlf buffer name."
|
|
||||||
(format "%s(%d/%d)"
|
|
||||||
(file-name-nondirectory buffer-file-name)
|
|
||||||
(/ vlf-end-pos vlf-batch-size)
|
|
||||||
(/ vlf-file-size vlf-batch-size)))
|
|
||||||
|
|
||||||
(defun vlf-update-buffer-name ()
|
(defun vlf-update-buffer-name ()
|
||||||
"Update the current buffer name and modeline."
|
"Update the current buffer name."
|
||||||
(rename-buffer (vlf-format-buffer-name) t)
|
(rename-buffer (format "%s(%d/%d)[%s]"
|
||||||
(setq minor-mode-alist
|
(file-name-nondirectory buffer-file-name)
|
||||||
(mapcar (lambda (x)
|
(/ vlf-end-pos vlf-batch-size)
|
||||||
(if (eq 'vlf-mode (car x))
|
(/ vlf-file-size vlf-batch-size)
|
||||||
`(vlf-mode ,(format " VLF[%s]"
|
(file-size-human-readable vlf-batch-size))
|
||||||
(file-size-human-readable
|
t))
|
||||||
vlf-batch-size)))
|
|
||||||
x))
|
|
||||||
minor-mode-alist)))
|
|
||||||
|
|
||||||
(defun vlf-get-file-size (file)
|
(defun vlf-get-file-size (file)
|
||||||
"Get size in bytes of FILE."
|
"Get size in bytes of FILE."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user