changeset 28198:1ea4cf592264

(view-mode-disable): Kill local binding of view-read-only.
author Richard M. Stallman <rms@gnu.org>
date Sun, 19 Mar 2000 15:56:40 +0000
parents aaa6448240eb
children 56a776500341
files lisp/view.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/view.el	Sun Mar 19 15:56:23 2000 +0000
+++ b/lisp/view.el	Sun Mar 19 15:56:40 2000 +0000
@@ -458,6 +458,14 @@
   (remove-hook 'change-major-mode-hook 'view-mode-disable t)
   (and view-overlay (delete-overlay view-overlay))
   (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
 	Helper-return-blurb view-old-Helper-return-blurb)
   (if buffer-read-only