mirror of
				https://github.com/m00natic/vlfi.git
				synced 2025-10-30 22:53:37 +00:00 
			
		
		
		
	Restore undo information after temporarily disabling it.
This commit is contained in:
		
							
								
								
									
										8
									
								
								vlf.el
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								vlf.el
									
									
									
									
									
								
							| @@ -108,12 +108,10 @@ continuously recenter.") | |||||||
|  |  | ||||||
| (defmacro vlf-with-undo-disabled (&rest body) | (defmacro vlf-with-undo-disabled (&rest body) | ||||||
|   "Execute BODY with temporarily disabled undo." |   "Execute BODY with temporarily disabled undo." | ||||||
|   `(let ((undo-enabled (not (eq buffer-undo-list t)))) |   `(let ((undo-list buffer-undo-list)) | ||||||
|      (if undo-enabled |      (setq buffer-undo-list t) | ||||||
|          (buffer-disable-undo)) |  | ||||||
|      (unwind-protect (progn ,@body) |      (unwind-protect (progn ,@body) | ||||||
|        (if undo-enabled |        (setq buffer-undo-list undo-list)))) | ||||||
|            (buffer-enable-undo))))) |  | ||||||
|  |  | ||||||
| (define-minor-mode vlf-mode | (define-minor-mode vlf-mode | ||||||
|   "Mode to browse large files in." |   "Mode to browse large files in." | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user