diff --git a/README.org b/README.org index 75160e4..034ca4e 100644 --- a/README.org +++ b/README.org @@ -49,10 +49,8 @@ example you can directly press digits to enter prefix arguments. ** Changing major mode -You can temporarily change major mode to whatever you like. Just -*don't save*! Turn to *vlfi-edit-mode* first (may need to mark buffer -as modified if needed). And you can return to *vlfi-mode* too if you -haven't changed anything. +You can temporarily change major mode to whatever you like. Saving +will insert contents as intended. You can return to *vlfi-mode* too. * Detail usage diff --git a/vlfi.el b/vlfi.el index e2f3e4b..2fb8ae0 100644 --- a/vlfi.el +++ b/vlfi.el @@ -76,7 +76,8 @@ (setq buffer-read-only t) (set-buffer-modified-p nil) (buffer-disable-undo) - (add-hook 'write-contents-functions 'vlfi-write) + (make-local-variable 'write-file-functions) + (add-hook 'write-file-functions 'vlfi-write) (make-local-variable 'revert-buffer-function) (setq revert-buffer-function 'vlfi-revert) (make-local-variable 'vlfi-batch-size)