Commit b75c9917 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(view-mode-disable): Kill local binding of view-read-only.

parent e53ae11c
...@@ -458,6 +458,14 @@ Entry to view-mode runs the normal hook `view-mode-hook'." ...@@ -458,6 +458,14 @@ Entry to view-mode runs the normal hook `view-mode-hook'."
(remove-hook 'change-major-mode-hook 'view-mode-disable t) (remove-hook 'change-major-mode-hook 'view-mode-disable t)
(and view-overlay (delete-overlay view-overlay)) (and view-overlay (delete-overlay view-overlay))
(force-mode-line-update) (force-mode-line-update)
;; Calling toggle-read-only while View mode is enabled
;; sets view-read-only to t as a buffer-local variable
;; after exiting View mode. That arranges that the next toggle-read-only
;; will reenable View mode.
;; Cancelling View mode in any other way should cancel that, too,
;; so that View mode stays off if toggle-read-only is called.
(if (local-variable-p 'view-read-only)
(kill-local-variable 'view-read-only))
(setq view-mode nil (setq view-mode nil
Helper-return-blurb view-old-Helper-return-blurb) Helper-return-blurb view-old-Helper-return-blurb)
(if buffer-read-only (if buffer-read-only
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment