emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/vlf 1c961f4 285/310: Fix whole file reload in read-only


From: Stefan Monnier
Subject: [elpa] externals/vlf 1c961f4 285/310: Fix whole file reload in read-only buffer on vlf-mode exit.
Date: Sat, 28 Nov 2020 00:33:33 -0500 (EST)

branch: externals/vlf
commit 1c961f45b2bd10b8db8299f9798ea99ea12dbcde
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>

    Fix whole file reload in read-only buffer on vlf-mode exit.
---
 vlf.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/vlf.el b/vlf.el
index e3c4f37..cc251ba 100644
--- a/vlf.el
+++ b/vlf.el
@@ -140,14 +140,16 @@ values are: `write', `ediff', `occur', `search', 
`goto-line'."
                (if (consp buffer-undo-list)
                    (setq buffer-undo-list nil))
                (vlf-with-undo-disabled
-                (insert-file-contents-literally buffer-file-name
-                                                t nil nil t)
-                (hexlify-buffer))
+                (let ((inhibit-read-only t))
+                  (insert-file-contents-literally buffer-file-name
+                                                  t nil nil t)
+                  (hexlify-buffer)))
                (set-buffer-modified-p nil)
                (goto-char (point-min))
                (forward-line line)
                (forward-char pos))
-           (let ((pos (+ vlf-start-pos (position-bytes (point)))))
+           (let ((pos (+ vlf-start-pos (position-bytes (point))))
+                 (inhibit-read-only t))
              (vlf-with-undo-disabled
               (insert-file-contents buffer-file-name t nil nil t))
              (goto-char (byte-to-position pos)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]