X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/7e09ef09a479731d01b1ca46e94ddadd73ac98e3..dacde7ee5d37a1fe685a489c65678a8f2c2535ce:/lisp/files-x.el diff --git a/lisp/files-x.el b/lisp/files-x.el index 248c307330..f0102fd83a 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -1,6 +1,6 @@ ;;; files-x.el --- extended file handling commands -;; Copyright (C) 2009-2015 Free Software Foundation, Inc. +;; Copyright (C) 2009-2016 Free Software Foundation, Inc. ;; Author: Juri Linkov ;; Maintainer: emacs-devel@gnu.org @@ -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