aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/files-x.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/files-x.el b/lisp/files-x.el
index 248c3073307..a130ffcf928 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -247,7 +247,14 @@ then this function adds the first line containing the string
247`Local Variables:' and the last line containing the string `End:'." 247`Local Variables:' and the last line containing the string `End:'."
248 (interactive 248 (interactive
249 (let ((variable (read-file-local-variable "Add file-local variable"))) 249 (let ((variable (read-file-local-variable "Add file-local variable")))
250 ;; Error before reading value.
251 (if (equal variable 'lexical-binding)
252 (user-error "The `%s' variable must be set at the start of the file"
253 variable))
250 (list variable (read-file-local-variable-value variable) t))) 254 (list variable (read-file-local-variable-value variable) t)))
255 (if (equal variable 'lexical-binding)
256 (user-error "The `%s' variable must be set at the start of the file"
257 variable))
251 (modify-file-local-variable variable value 'add-or-replace interactive)) 258 (modify-file-local-variable variable value 'add-or-replace interactive))
252 259
253;;;###autoload 260;;;###autoload