pjb-page: keep view-mode around normal-mode.

Pascal J. Bourguignon [2021-10-05 13:32]
pjb-page: keep view-mode around normal-mode.
Filename
pjb-page.el
diff --git a/pjb-page.el b/pjb-page.el
index 4a54e6c..9dadaf5 100644
--- a/pjb-page.el
+++ b/pjb-page.el
@@ -76,12 +76,16 @@
   (interactive "p")
   (pjb-set-page-mode-key-bindings on)
   (unless on
-    (normal-mode t)))
+    (let ((view view-mode))
+      (normal-mode t)
+      (when view (view-mode 1)))))

 (defun pjb-narrow-to-page (&optional arg)
   (interactive)
   (narrow-to-page arg)
-  (normal-mode t)
+  (let ((view view-mode))
+    (normal-mode t)
+    (when view (view-mode 1)))
   (pjb-reset-page-mode-key-bindings))

 (defun pm-forward-page (&optional count)
ViewGit