emacs-diffs
[Top][All Lists]
Advanced

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

master 3c2db0c: Make `so-long' restore `view-mode'


From: Lars Ingebrigtsen
Subject: master 3c2db0c: Make `so-long' restore `view-mode'
Date: Sun, 6 Jun 2021 06:33:26 -0400 (EDT)

branch: master
commit 3c2db0c541491fceb7081d5b54de5abec25e2f4b
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make `so-long' restore `view-mode'
    
    * lisp/so-long.el (so-long): Make the `v' command in Dired work
    more reliably (bug#45084).
---
 lisp/so-long.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/so-long.el b/lisp/so-long.el
index f916b61..d765d34 100644
--- a/lisp/so-long.el
+++ b/lisp/so-long.el
@@ -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'.



reply via email to

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