diff options
| author | Stefan Monnier | 2011-03-01 00:03:24 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2011-03-01 00:03:24 -0500 |
| commit | d032d5e7dfabfae60f3304da02c97cd1e189b9a2 (patch) | |
| tree | 64219849ec4b697e19a1da1c2a5786b61a2c3387 /doc/lispref/eval.texi | |
| parent | 39605a343b566a1a72e0afb61f96d085c2ef8054 (diff) | |
| download | emacs-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.texi | 10 |
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 | |||
| 585 | write code that evaluates a form that is computed at run time, such as | 585 | write code that evaluates a form that is computed at run time, such as |
| 586 | after reading a form from text being edited or getting one from a | 586 | after reading a form from text being edited or getting one from a |
| 587 | property list. On these occasions, use the @code{eval} function. | 587 | property list. On these occasions, use the @code{eval} function. |
| 588 | Often @code{eval} is not needed and something else should be used instead. | ||
| 589 | For example, to get the value of a variable, while @code{eval} works, | ||
| 590 | @code{symbol-value} is preferable; or rather than store expressions | ||
| 591 | in a property list that then need to go through @code{eval}, it is better to | ||
| 592 | store 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, |
| 590 | specify limits to the evaluation process, or record recently returned | 595 | specify 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 | |||
| 596 | functions provides the ability to pass information to them as | 601 | functions provides the ability to pass information to them as |
| 597 | arguments. | 602 | arguments. |
| 598 | 603 | ||
| 599 | @defun eval form | 604 | @defun eval form &optional lexical |
| 600 | This is the basic function evaluating an expression. It evaluates | 605 | This 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 |
| 602 | evaluation proceeds depends on the type of the object (@pxref{Forms}). | 607 | evaluation proceeds depends on the type of the object (@pxref{Forms}). |
| 608 | @var{lexical} if non-nil means to evaluate @var{form} using lexical scoping | ||
| 609 | rules (@pxref{Lexical Binding}) instead of the default dynamic scoping used | ||
| 610 | historically in Emacs Lisp. | ||
| 603 | 611 | ||
| 604 | Since @code{eval} is a function, the argument expression that appears | 612 | Since @code{eval} is a function, the argument expression that appears |
| 605 | in a call to @code{eval} is evaluated twice: once as preparation before | 613 | in a call to @code{eval} is evaluated twice: once as preparation before |