mirror of
				https://github.com/m00natic/vlfi.git
				synced 2025-11-04 09:01:37 +00:00 
			
		
		
		
	Add command to set batch size explicitly.
This commit is contained in:
		@@ -92,12 +92,12 @@ Here's example how to add another prefix (*C-x v*):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
** Control batch size
 | 
					** Control batch size
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Use *M-x vlf-set-batch-size* to change batch size and update chunk
 | 
				
			||||||
 | 
					immediately.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
*C-c C-v +* and *C-c C-v -* control current batch size by factors
 | 
					*C-c C-v +* and *C-c C-v -* control current batch size by factors
 | 
				
			||||||
of 2.
 | 
					of 2.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
You can also set by hand local variable *vlf-batch-size* and then
 | 
					 | 
				
			||||||
refresh with *C-c C-v g*.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
** Move around
 | 
					** Move around
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Scrolling automatically triggers moving to previous or next chunk at
 | 
					Scrolling automatically triggers moving to previous or next chunk at
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										13
									
								
								vlf.el
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								vlf.el
									
									
									
									
									
								
							@@ -53,6 +53,8 @@
 | 
				
			|||||||
  "Toggle continuous chunk recenter around current point.")
 | 
					  "Toggle continuous chunk recenter around current point.")
 | 
				
			||||||
(autoload 'vlf-stop-follow "vlf-follow"
 | 
					(autoload 'vlf-stop-follow "vlf-follow"
 | 
				
			||||||
  "Stop continuous recenter.")
 | 
					  "Stop continuous recenter.")
 | 
				
			||||||
 | 
					(autoload 'vlf-ediff-buffers "vlf-ediff"
 | 
				
			||||||
 | 
					  "Run batch by batch ediff over VLF buffers." t)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defvar vlf-mode-map
 | 
					(defvar vlf-mode-map
 | 
				
			||||||
  (let ((map (make-sparse-keymap)))
 | 
					  (let ((map (make-sparse-keymap)))
 | 
				
			||||||
@@ -71,6 +73,7 @@
 | 
				
			|||||||
    (define-key map "]" 'vlf-end-of-file)
 | 
					    (define-key map "]" 'vlf-end-of-file)
 | 
				
			||||||
    (define-key map "j" 'vlf-jump-to-chunk)
 | 
					    (define-key map "j" 'vlf-jump-to-chunk)
 | 
				
			||||||
    (define-key map "l" 'vlf-goto-line)
 | 
					    (define-key map "l" 'vlf-goto-line)
 | 
				
			||||||
 | 
					    (define-key map "e" 'vlf-ediff-buffers)
 | 
				
			||||||
    (define-key map "f" 'vlf-toggle-follow)
 | 
					    (define-key map "f" 'vlf-toggle-follow)
 | 
				
			||||||
    (define-key map "g" 'vlf-revert)
 | 
					    (define-key map "g" 'vlf-revert)
 | 
				
			||||||
    map)
 | 
					    map)
 | 
				
			||||||
@@ -186,9 +189,13 @@ When prefix argument is negative
 | 
				
			|||||||
Normally, the value is doubled;
 | 
					Normally, the value is doubled;
 | 
				
			||||||
with the prefix argument DECREASE it is halved."
 | 
					with the prefix argument DECREASE it is halved."
 | 
				
			||||||
  (interactive "P")
 | 
					  (interactive "P")
 | 
				
			||||||
  (setq vlf-batch-size (if decrease
 | 
					  (vlf-set-batch-size (if decrease (/ vlf-batch-size 2)
 | 
				
			||||||
                           (/ vlf-batch-size 2)
 | 
					                        (* vlf-batch-size 2))))
 | 
				
			||||||
                         (* vlf-batch-size 2)))
 | 
					
 | 
				
			||||||
 | 
					(defun vlf-set-batch-size (size)
 | 
				
			||||||
 | 
					  "Set batch to SIZE bytes and update chunk."
 | 
				
			||||||
 | 
					  (interactive (list (read-number "Size in bytes: " vlf-batch-size)))
 | 
				
			||||||
 | 
					  (setq vlf-batch-size size)
 | 
				
			||||||
  (vlf-move-to-batch vlf-start-pos))
 | 
					  (vlf-move-to-batch vlf-start-pos))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defun vlf-beginning-of-file ()
 | 
					(defun vlf-beginning-of-file ()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user