aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/forms.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/forms.el b/lisp/forms.el
index c141188788b..c0b48fd3b63 100644
--- a/lisp/forms.el
+++ b/lisp/forms.el
@@ -589,7 +589,14 @@ Commands: Equivalent keys in read-only mode:
589 (make-local-variable 'forms--dynamic-text) 589 (make-local-variable 'forms--dynamic-text)
590 590
591 ;; Prevent accidental overwrite of the control file and auto-save. 591 ;; Prevent accidental overwrite of the control file and auto-save.
592 (set-visited-file-name nil) 592 ;; We bind change-major-mode-with-file-name to nil to prevent
593 ;; set-visited-file-name from calling set-auto-mode, which
594 ;; might kill all local variables and set forms-file nil,
595 ;; which will then barf in find-file-noselect below. This can
596 ;; hapen when the user sets the default major mode that is
597 ;; different from the Fundamental mode.
598 (let (change-major-mode-with-file-name)
599 (set-visited-file-name nil))
593 600
594 ;; Prepare this buffer for further processing. 601 ;; Prepare this buffer for further processing.
595 (setq buffer-read-only nil) 602 (setq buffer-read-only nil)