aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/forms.el
diff options
context:
space:
mode:
authorEli Zaretskii2016-03-12 13:05:49 +0200
committerEli Zaretskii2016-03-12 13:05:49 +0200
commit06aad394ab3cd83de8fc407e5dfeb59aa8518557 (patch)
treed60d44f36aabccffd38ce5022e210113652a94df /lisp/forms.el
parent48196164aa206d057874119cac2025d376566365 (diff)
downloademacs-06aad394ab3cd83de8fc407e5dfeb59aa8518557.tar.gz
emacs-06aad394ab3cd83de8fc407e5dfeb59aa8518557.zip
Avoid errors in forms-mode when default major mode is text
* lisp/forms.el (forms-mode): Bind change-major-mode-with-file-name to nil when calling set-visited-file-name. (Bug#22982)
Diffstat (limited to 'lisp/forms.el')
-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)