emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 6bf9bdb: * lisp/files-x.el (add-file-local-variable


From: Glenn Morris
Subject: [Emacs-diffs] master 6bf9bdb: * lisp/files-x.el (add-file-local-variable):
Date: Wed, 10 Jun 2015 20:38:22 +0000

branch: master
commit 6bf9bdb4b155f3f330c0e2b6eb00c45c8e01f54b
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    * lisp/files-x.el (add-file-local-variable):
    
    Special-case 'lexical-binding'.  (Bug#20641)
---
 lisp/files-x.el |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lisp/files-x.el b/lisp/files-x.el
index 248c307..a130ffc 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
 `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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]