]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `so-long' restore `view-mode'
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 6 Jun 2021 10:33:13 +0000 (12:33 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 6 Jun 2021 10:33:21 +0000 (12:33 +0200)
* lisp/so-long.el (so-long): Make the `v' command in Dired work
more reliably (bug#45084).

lisp/so-long.el

index f916b61b60fcc937e1534b3b22871e2baa9a359a..d765d3449ca5c09611e38722f2046f25aa616106 100644 (file)
@@ -1648,7 +1648,8 @@ invoking the new action."
     (when so-long--active
       (so-long-revert))
     ;; Invoke the new action.
-    (let ((so-long--calling t))
+    (let ((so-long--calling t)
+          (view-mode-active view-mode))
       (so-long--ensure-enabled)
       ;; ACTION takes precedence if supplied.
       (when action
@@ -1677,7 +1678,10 @@ invoking the new action."
       ;; functions need to modify the buffer.  We use `inhibit-read-only' to
       ;; side-step the issue (and likewise in `so-long-revert').
       (let ((inhibit-read-only t))
-        (run-hooks 'so-long-hook)))))
+        (run-hooks 'so-long-hook))
+      ;; Restore `view-mode'.
+      (when view-mode-active
+        (view-mode)))))
 
 (defun so-long-revert ()
   "Revert the active `so-long-action' and run `so-long-revert-hook'.