X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/39eb0cb563f5287270f3946804456dc766386638..73d213f2816876fe9c6c429e75a3be5454a42b34:/lisp/files-x.el diff --git a/lisp/files-x.el b/lisp/files-x.el index adc2b8b3bf..f0102fd83a 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -1,9 +1,9 @@ ;;; files-x.el --- extended file handling commands -;; Copyright (C) 2009-2013 Free Software Foundation, Inc. +;; Copyright (C) 2009-2016 Free Software Foundation, Inc. ;; Author: Juri Linkov -;; Maintainer: FSF +;; Maintainer: emacs-devel@gnu.org ;; Keywords: files ;; Package: emacs @@ -247,7 +247,14 @@ then this function adds the first line containing the string `Local Variables:' and the last line containing the string `End:'." (interactive (let ((variable (read-file-local-variable "Add file-local variable"))) + ;; Error before reading value. + (if (equal variable 'lexical-binding) + (user-error "The `%s' variable must be set at the start of the file" + variable)) (list variable (read-file-local-variable-value variable) t))) + (if (equal variable 'lexical-binding) + (user-error "The `%s' variable must be set at the start of the file" + variable)) (modify-file-local-variable variable value 'add-or-replace interactive)) ;;;###autoload