aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2012-06-08 09:18:26 -0400
committerStefan Monnier2012-06-08 09:18:26 -0400
commit513749ee1862278385028d6700e1d2ce8abd35e6 (patch)
treecb835ce77cd2aa8d828dca57b55642e85f3942c5 /src
parent595ef4ad76fb75db4a0adb2baf117ef6d68a2e41 (diff)
downloademacs-513749ee1862278385028d6700e1d2ce8abd35e6.tar.gz
emacs-513749ee1862278385028d6700e1d2ce8abd35e6.zip
Clean up scoping rule of predefined single-word vars.
* lisp/startup.el (argv, argi): Make lexically scoped. * lisp/emacs-lisp/float-sup.el (pi): Use internal-make-var-non-special. * lisp/emacs-lisp/cl-macs.el: Use lexical-binding. Rename cl-bind-* to cl--bind-*. * lisp/files.el: Don't require `cl' since it doesn't use it. * lisp/emacs-lisp/pcase.el, lisp/emacs-lisp/macroexp.el: Add coding cookie. * src/eval.c (Fmake_var_non_special): New primitive. (syms_of_eval): Defsubr it. * src/lread.c (syms_of_lread): Mark `values' as lexically scoped.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/eval.c12
-rw-r--r--src/lread.c7
3 files changed, 23 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ff9664d208f..dd668212615 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * eval.c (Fmake_var_non_special): New primitive.
4 (syms_of_eval): Defsubr it.
5 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6
12012-06-08 Juanma Barranquero <lekktu@gmail.com> 72012-06-08 Juanma Barranquero <lekktu@gmail.com>
2 8
3 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused 9 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
@@ -23,7 +29,7 @@
23 (roundup_size): New constant. 29 (roundup_size): New constant.
24 (struct vector_block): New data type. 30 (struct vector_block): New data type.
25 (vector_blocks, vector_free_lists, zero_vector): New variables. 31 (vector_blocks, vector_free_lists, zero_vector): New variables.
26 (all_vectors): Renamed to `large_vectors'. 32 (all_vectors): Rename to `large_vectors'.
27 (allocate_vector_from_block, init_vectors, allocate_vector_from_block) 33 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
28 (sweep_vectors): New functions. 34 (sweep_vectors): New functions.
29 (allocate_vectorlike): Return `zero_vector' as the only vector of 35 (allocate_vectorlike): Return `zero_vector' as the only vector of
diff --git a/src/eval.c b/src/eval.c
index 85ff3ae19e6..5a9327a99d8 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -790,6 +790,17 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
790 return sym; 790 return sym;
791} 791}
792 792
793/* Make SYMBOL lexically scoped. */
794DEFUN ("internal-make-var-non-special", Fmake_var_non_special,
795 Smake_var_non_special, 1, 1, 0,
796 doc: /* Internal function. */)
797 (Lisp_Object symbol)
798{
799 CHECK_SYMBOL (symbol);
800 XSYMBOL (symbol)->declared_special = 0;
801 return Qnil;
802}
803
793 804
794DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0, 805DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0,
795 doc: /* Bind variables according to VARLIST then eval BODY. 806 doc: /* Bind variables according to VARLIST then eval BODY.
@@ -3582,6 +3593,7 @@ alist of active lexical bindings. */);
3582 defsubr (&Sdefvar); 3593 defsubr (&Sdefvar);
3583 defsubr (&Sdefvaralias); 3594 defsubr (&Sdefvaralias);
3584 defsubr (&Sdefconst); 3595 defsubr (&Sdefconst);
3596 defsubr (&Smake_var_non_special);
3585 defsubr (&Slet); 3597 defsubr (&Slet);
3586 defsubr (&SletX); 3598 defsubr (&SletX);
3587 defsubr (&Swhile); 3599 defsubr (&Swhile);
diff --git a/src/lread.c b/src/lread.c
index 38b00a66962..726f1f0e905 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4375,7 +4375,8 @@ to find all the symbols in an obarray, use `mapatoms'. */);
4375 4375
4376 DEFVAR_LISP ("values", Vvalues, 4376 DEFVAR_LISP ("values", Vvalues,
4377 doc: /* List of values of all expressions which were read, evaluated and printed. 4377 doc: /* List of values of all expressions which were read, evaluated and printed.
4378Order is reverse chronological. */); 4378 Order is reverse chronological. */);
4379 XSYMBOL (intern ("values"))->declared_special = 0;
4379 4380
4380 DEFVAR_LISP ("standard-input", Vstandard_input, 4381 DEFVAR_LISP ("standard-input", Vstandard_input,
4381 doc: /* Stream for read to get input from. 4382 doc: /* Stream for read to get input from.
@@ -4393,7 +4394,7 @@ defined, although they may be in the future.
4393 4394
4394The positions are relative to the last call to `read' or 4395The positions are relative to the last call to `read' or
4395`read-from-string'. It is probably a bad idea to set this variable at 4396`read-from-string'. It is probably a bad idea to set this variable at
4396the toplevel; bind it instead. */); 4397the toplevel; bind it instead. */);
4397 Vread_with_symbol_positions = Qnil; 4398 Vread_with_symbol_positions = Qnil;
4398 4399
4399 DEFVAR_LISP ("read-symbol-positions-list", Vread_symbol_positions_list, 4400 DEFVAR_LISP ("read-symbol-positions-list", Vread_symbol_positions_list,
@@ -4408,7 +4409,7 @@ symbol from the position where `read' or `read-from-string' started.
4408 4409
4409Note that a symbol will appear multiple times in this list, if it was 4410Note that a symbol will appear multiple times in this list, if it was
4410read multiple times. The list is in the same order as the symbols 4411read multiple times. The list is in the same order as the symbols
4411were read in. */); 4412were read in. */);
4412 Vread_symbol_positions_list = Qnil; 4413 Vread_symbol_positions_list = Qnil;
4413 4414
4414 DEFVAR_LISP ("read-circle", Vread_circle, 4415 DEFVAR_LISP ("read-circle", Vread_circle,