From: Glenn Morris Date: Thu, 26 Jan 2012 06:30:49 +0000 (-0800) Subject: Doc fix for lexical-binding being in line one. X-Git-Tag: emacs-pretest-24.0.93~63 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=48da73922734c056f48ed3cd675a97369ac025ea;p=emacs.git Doc fix for lexical-binding being in line one. Ref http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00543.html * doc/lispref/variables.texi (Using Lexical Binding): Mention that lexical-binding should be set in the first line. * src/lread.c (syms_of_lread): Doc fix. * lisp/emacs-lisp/tabulated-list.el, lisp/progmodes/f90.el: Move lexical-binding file-local to line one. * etc/NEWS: lexical-binding should be ine the first line. --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 69eca805eea..145d2dbc4f5 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2012-01-26 Glenn Morris + + * variables.texi (Using Lexical Binding): + Mention that lexical-binding should be set in the first line. + 2012-01-26 Lars Ingebrigtsen * macros.texi (Defining Macros): Don't claim that `declare' only diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index ec52d4ab9ea..9e0c439e57e 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1047,6 +1047,8 @@ binding. (However, special variables are still dynamically bound; see below.) If @code{nil}, dynamic binding is used for all local variables. This variable is typically set for a whole Emacs Lisp file, as a file local variable (@pxref{File Local Variables}). +Note that unlike other such variables, this one must be set in the +first line of a file. @end defvar @noindent diff --git a/etc/NEWS b/etc/NEWS index ccf2441c656..3c6fd355d78 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1026,8 +1026,8 @@ sc.el, x-menu.el, rnews.el, rnewspost.el ** Code can now use lexical scoping by default instead of dynamic scoping. The `lexical-binding' variable lets code use lexical scoping for local -variables. It is typically set via file-local variables, in which case it -applies to all the code in that file. +variables. It is typically set via a file-local variable in the first +line of the file, in which case it applies to all the code in that file. *** `eval' takes a new optional argument `lexical' to choose the new lexical binding instead of the old dynamic binding mode. diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 486635f7091..8fe514ab551 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -1,4 +1,4 @@ -;;; tabulated-list.el --- generic major mode for tabulated lists. +;;; tabulated-list.el --- generic major mode for tabulated lists -*- lexical-binding: t -*- ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. @@ -362,7 +362,6 @@ as the ewoc pretty-printer." ;; Local Variables: ;; coding: utf-8 -;; lexical-binding: t ;; End: ;;; tabulated-list.el ends here diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 25f8107340a..df6fdfd7cd9 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -1,4 +1,4 @@ -;;; f90.el --- Fortran-90 mode (free format) +;;; f90.el --- Fortran-90 mode (free format) -*- lexical-binding: t -*- ;; Copyright (C) 1995-1997, 2000-2012 Free Software Foundation, Inc. @@ -2319,7 +2319,6 @@ escape character." ;; Local Variables: ;; coding: utf-8 -;; lexical-binding: t ;; End: ;;; f90.el ends here diff --git a/src/ChangeLog b/src/ChangeLog index cc149458e02..9d37a04da2c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-01-26 Glenn Morris + + * lread.c (syms_of_lread): Doc fix. + 2012-01-25 HIROSHI OOTA (tiny change) * coding.c (encode_designation_at_bol): Change return value to diff --git a/src/lread.c b/src/lread.c index 23cda8eed6d..353f4a3064d 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4595,7 +4595,8 @@ to load. See also `load-dangerous-libraries'. */); Non-nil means that the code in the current buffer should be evaluated with lexical binding. This variable is automatically set from the file variables of an -interpreted Lisp file read using `load'. */); +interpreted Lisp file read using `load'. Unlike other file local +variables, this must be set in the first line of a file. */); Fmake_variable_buffer_local (Qlexical_binding); DEFVAR_LISP ("eval-buffer-list", Veval_buffer_list,