From 3c2db0c541491fceb7081d5b54de5abec25e2f4b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 6 Jun 2021 12:33:13 +0200 Subject: [PATCH] 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 f916b61b60f..d765d3449ca 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'. -- 2.39.2