aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref/eval.texi
diff options
context:
space:
mode:
authorStefan Monnier2011-03-01 00:03:24 -0500
committerStefan Monnier2011-03-01 00:03:24 -0500
commitd032d5e7dfabfae60f3304da02c97cd1e189b9a2 (patch)
tree64219849ec4b697e19a1da1c2a5786b61a2c3387 /doc/lispref/eval.texi
parent39605a343b566a1a72e0afb61f96d085c2ef8054 (diff)
downloademacs-d032d5e7dfabfae60f3304da02c97cd1e189b9a2.tar.gz
emacs-d032d5e7dfabfae60f3304da02c97cd1e189b9a2.zip
* doc/lispref/variables.texi (Scope): Mention the availability of lexbind.
(Lexical Binding): New node. * doc/lispref/eval.texi (Eval): Add `eval's new `lexical' arg. * lisp/emacs-lisp/cconv.el (cconv-liftwhen): Increase threshold. (cconv-closure-convert-rec): Convert interactive spec in empty lexenv. (cconv-analyse-use): Improve unused vars warnings. (cconv-analyse-form): Analyze interactive spec in empty lexenv. * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Always byte-compile the interactive spec in lexical-binding mode. (byte-compile-refresh-preloaded): Don't reload byte-compiler files. * lisp/custom.el (custom-initialize-default): Use defvar. (custom-declare-variable): Set the special-variable-p flag. * lisp/help-fns.el (help-make-usage): Drop leading underscores. * lisp/dired.el (dired-revert, dired-make-relative): Mark unused args. (dired-unmark-all-files): Remove unused var `query'. (dired-overwrite-confirmed): Declare. (dired-restore-desktop-buffer): Don't use dynamically scoped arg names. * lisp/mpc.el: Mark unused args. (mpc--faster-toggle): Remove unused var `songnb'. * lisp/server.el (server-kill-buffer-running): Move before first use. * lisp/minibuffer.el: Mark unused args. * src/callint.c (quotify_arg): Simplify the logic. (Fcall_interactively): Use lexical binding when evaluating the interactive spec of a lexically bound function.
Diffstat (limited to 'doc/lispref/eval.texi')
-rw-r--r--doc/lispref/eval.texi10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi
index d44fe5bb95b..74f3d9c48b9 100644
--- a/doc/lispref/eval.texi
+++ b/doc/lispref/eval.texi
@@ -585,6 +585,11 @@ occurrence in a program being run. On rare occasions, you may need to
585write code that evaluates a form that is computed at run time, such as 585write code that evaluates a form that is computed at run time, such as
586after reading a form from text being edited or getting one from a 586after reading a form from text being edited or getting one from a
587property list. On these occasions, use the @code{eval} function. 587property list. On these occasions, use the @code{eval} function.
588Often @code{eval} is not needed and something else should be used instead.
589For example, to get the value of a variable, while @code{eval} works,
590@code{symbol-value} is preferable; or rather than store expressions
591in a property list that then need to go through @code{eval}, it is better to
592store functions instead that are then passed to @code{funcall}.
588 593
589 The functions and variables described in this section evaluate forms, 594 The functions and variables described in this section evaluate forms,
590specify limits to the evaluation process, or record recently returned 595specify limits to the evaluation process, or record recently returned
@@ -596,10 +601,13 @@ to store an expression in the data structure and evaluate it. Using
596functions provides the ability to pass information to them as 601functions provides the ability to pass information to them as
597arguments. 602arguments.
598 603
599@defun eval form 604@defun eval form &optional lexical
600This is the basic function evaluating an expression. It evaluates 605This is the basic function evaluating an expression. It evaluates
601@var{form} in the current environment and returns the result. How the 606@var{form} in the current environment and returns the result. How the
602evaluation proceeds depends on the type of the object (@pxref{Forms}). 607evaluation proceeds depends on the type of the object (@pxref{Forms}).
608@var{lexical} if non-nil means to evaluate @var{form} using lexical scoping
609rules (@pxref{Lexical Binding}) instead of the default dynamic scoping used
610historically in Emacs Lisp.
603 611
604Since @code{eval} is a function, the argument expression that appears 612Since @code{eval} is a function, the argument expression that appears
605in a call to @code{eval} is evaluated twice: once as preparation before 613in a call to @code{eval} is evaluated twice: once as preparation before