diff options
| -rw-r--r-- | lisp/view.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/view.el b/lisp/view.el index e6024601679..e57ac270b18 100644 --- a/lisp/view.el +++ b/lisp/view.el | |||
| @@ -458,6 +458,14 @@ Entry to view-mode runs the normal hook `view-mode-hook'." | |||
| 458 | (remove-hook 'change-major-mode-hook 'view-mode-disable t) | 458 | (remove-hook 'change-major-mode-hook 'view-mode-disable t) |
| 459 | (and view-overlay (delete-overlay view-overlay)) | 459 | (and view-overlay (delete-overlay view-overlay)) |
| 460 | (force-mode-line-update) | 460 | (force-mode-line-update) |
| 461 | ;; Calling toggle-read-only while View mode is enabled | ||
| 462 | ;; sets view-read-only to t as a buffer-local variable | ||
| 463 | ;; after exiting View mode. That arranges that the next toggle-read-only | ||
| 464 | ;; will reenable View mode. | ||
| 465 | ;; Cancelling View mode in any other way should cancel that, too, | ||
| 466 | ;; so that View mode stays off if toggle-read-only is called. | ||
| 467 | (if (local-variable-p 'view-read-only) | ||
| 468 | (kill-local-variable 'view-read-only)) | ||
| 461 | (setq view-mode nil | 469 | (setq view-mode nil |
| 462 | Helper-return-blurb view-old-Helper-return-blurb) | 470 | Helper-return-blurb view-old-Helper-return-blurb) |
| 463 | (if buffer-read-only | 471 | (if buffer-read-only |