1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 06:50:46 -08:00
emacs/doc/lispref
Stefan Monnier 034086489c Merge from lexical-binding branch.
* doc/lispref/eval.texi (Eval): Discourage the use of `eval'.
Document its new `lexical' argument.

* doc/lispref/variables.texi (Defining Variables): Mention the new meaning of `defvar'.
(Lexical Binding): New sub-section.

* lisp/Makefile.in (BIG_STACK_DEPTH, BIG_STACK_OPTS, BYTE_COMPILE_FLAGS):
New variables.
(compile-onefile, .el.elc, compile-calc, recompile): Use them.
(COMPILE_FIRST): Add macroexp and cconv.
* lisp/makefile.w32-in: Mirror changes in Makefile.in.

* lisp/vc/cvs-status.el:
* lisp/vc/diff-mode.el:
* lisp/vc/log-edit.el:
* lisp/vc/log-view.el:
* lisp/vc/smerge-mode.el:
* lisp/textmodes/bibtex-style.el:
* textmodes/css.el:
* lisp/startup.el:
* lisp/uniquify.el:
* lisp/minibuffer.el: 
* lisp/newcomment.el: 
* lisp/reveal.el: 
* lisp/server.el: 
* lisp/mpc.el: 
* lisp/emacs-lisp/smie.el: 
* lisp/doc-view.el: 
* lisp/dired.el: 
* lisp/abbrev.el: Use lexical binding.

* lisp/custom.el (custom-initialize-default, custom-declare-variable):
Use `defvar'.

* lisp/files.el (lexical-binding): Declare safe.

* lisp/help-fns.el (help-split-fundoc): Return nil if there's nothing else
than the arglist.
(help-add-fundoc-usage): Don't add `Not documented'.
(help-function-arglist): Handle closures, subroutines, and new
byte-code-functions.
(help-make-usage): Remove leading underscores.
(describe-function-1): Handle closures.
(describe-variable): Use special-variable-p for completion.

* lisp/simple.el (with-wrapper-hook, apply-partially): Move to subr.el.

* lisp/subr.el (apply-partially): Use new closures rather than CL.
(--dolist-tail--, --dotimes-limit--): Don't declare dynamic.
(dolist, dotimes): Use slightly different expansion for lexical code.
(functionp): Move to C.
(letrec): New macro.
(with-wrapper-hook): Use it and apply-partially instead of CL.
(eval-after-load): Preserve lexical-binding.
(save-window-excursion, with-output-to-temp-buffer): Turn them
into macros.

* lisp/emacs-lisp/advice.el (ad-arglist): Use help-function-arglist.

* lisp/emacs-lisp/autoload.el (make-autoload): Don't burp on trivial macros.

* lisp/emacs-lisp/byte-opt.el: Use lexical binding.
(byte-inline-lapcode): Remove (to bytecomp).
(byte-compile-inline-expand): Pay attention to inlining to/from
lexically bound code.
(byte-compile-unfold-lambda): Don't handle byte-code-functions
any more.
(byte-optimize-form-code-walker): Don't handle save-window-excursion
any more and don't call compiler-macros.
(byte-compile-splice-in-already-compiled-code): Remove.
(byte-code): Don't inline any more.
(disassemble-offset): Receive `bytes' as argument rather than via
dynamic scoping.
(byte-compile-tag-number): Declare before first use.
(byte-decompile-bytecode-1): Handle new byte-codes, don't change
`return' even if make-spliceable.
(byte-compile-side-effect-and-error-free-ops): Add stack-ref, remove
obsolete interactive-p.
(byte-optimize-lapcode): Optimize new lap-codes.
Don't trip up on new form of `byte-constant' lap code.

* lisp/emacs-lisp/byte-run.el (make-obsolete): Don't set the `byte-compile'
handler any more.

* lisp/emacs-lisp/bytecomp.el: Use lexical binding instead of
a "bytecomp-" prefix.  Macroexpand everything as a separate phase.
(byte-compile-initial-macro-environment):
Handle declare-function here.
(byte-compile--lexical-environment): New var.
(byte-stack-ref, byte-stack-set, byte-discardN)
(byte-discardN-preserve-tos): New lap codes.
(byte-interactive-p): Don't use any more.
(byte-compile-push-bytecodes, byte-compile-push-bytecode-const2):
New macros.
(byte-compile-lapcode): Use them and handle new lap codes.
(byte-compile-obsolete): Remove.
(byte-compile-arglist-signature): Handle new byte-code arg"lists".
(byte-compile-arglist-warn): Check late def of inlinable funs.
(byte-compile-cl-warn): Don't silence warnings for compiler-macros
since they should have been expanded by now.
(byte-compile--outbuffer): Rename from bytecomp-outbuffer.
(byte-compile-from-buffer): Remove unused second arg.
(byte-compile-preprocess): New function.
(byte-compile-toplevel-file-form): New function to distinguish
file-form calls from outside from file-form calls from hunk-handlers.
(byte-compile-file-form): Simplify.
(byte-compile-file-form-defsubst): Remove.
(byte-compile-file-form-defmumble): Simplify now that
byte-compile-lambda always returns a byte-code-function.
(byte-compile): Preprocess.
(byte-compile-byte-code-maker, byte-compile-byte-code-unmake):
Remove, not used any more.
(byte-compile-arglist-vars, byte-compile-make-lambda-lexenv)
(byte-compile-make-args-desc): New funs.
(byte-compile-lambda): Handle lexical functions.  Always return
a byte-code-function.
(byte-compile-reserved-constants): New var, to make up room for
closed-over variables.
(byte-compile-constants-vector): Obey it.
(byte-compile-top-level): New args `lexenv' and `reserved-csts'.
(byte-compile-macroexpand-declare-function): New function.
(byte-compile-form): Call byte-compile-unfold-bcf to inline immediate
byte-code-functions.
(byte-compile-form): Check obsolescence here.
(byte-compile-inline-lapcode, byte-compile-unfold-bcf): New functions.
(byte-compile-variable-ref): Remove.
(byte-compile-dynamic-variable-op): New fun.
(byte-compile-dynamic-variable-bind, byte-compile-variable-ref)
(byte-compile-variable-set): New funs.
(byte-compile-discard): Add 2 args.
(byte-compile-stack-ref, byte-compile-stack-set)
(byte-compile-make-closure, byte-compile-get-closed-var): New funs.
(byte-compile-funarg, byte-compile-funarg-2): Remove, handled in
macroexpand-all instead.
(byte-compile-quote-form): Remove.
(byte-compile-push-binding-init, byte-compile-not-lexical-var-p)
(byte-compile-bind, byte-compile-unbind): New funs.
(byte-compile-let): Handle let* and lexical binding.
(byte-compile-let*): Remove.
(byte-compile-catch, byte-compile-unwind-protect)
(byte-compile-track-mouse, byte-compile-condition-case):
Handle a new :fun-body form, used for lexical scoping.
(byte-compile-save-window-excursion)
(byte-compile-with-output-to-temp-buffer): Remove.
(byte-compile-defun): Simplify.
(byte-compile-stack-adjustment): New fun.
(byte-compile-out): Use it.
(byte-compile-refresh-preloaded): Don't reload byte-compiler files.

* lisp/emacs-lisp/cconv.el: New file.

* lisp/emacs-lisp/cl-extra.el (cl-macroexpand-all): Properly quote CL
closures.

* lisp/emacs-lisp/cl-macs.el (cl-byte-compile-block)
(cl-byte-compile-throw): Remove.
(cl-block-wrapper, cl-block-throw): Use compiler-macros instead.

* lisp/emacs-lisp/cl.el (pushnew): Silence warning.

* lisp/emacs-lisp/disass.el (disassemble-internal): Handle new
`closure' objects.
(disassemble-1): Handle new byte codes.

* lisp/emacs-lisp/edebug.el (edebug-eval-defun)
(edebug-eval-top-level-form): Use eval-sexp-add-defvars.
(edebug-toggle): Avoid `eval'.

* lisp/emacs-lisp/eieio-comp.el: Remove.

* lisp/emacs-lisp/eieio.el (byte-compile-file-form-defmethod):
Don't autoload.
(eieio-defgeneric-form-primary-only-one): Use `byte-compile' rather
than the internal `byte-compile-lambda'.
(defmethod): Don't hide code under quotes.
(eieio-defmethod): New `code' argument.

* lisp/emacs-lisp/float-sup.el (pi): Don't declare as dynamically bound.

* lisp/emacs-lisp/lisp-mode.el (eval-last-sexp-1):
Use eval-sexp-add-defvars.
(eval-sexp-add-defvars): New fun.

* lisp/emacs-lisp/macroexp.el: Use lexical binding.
(macroexpand-all-1): Check obsolete macros.  Expand compiler-macros.
Don't convert ' to #' without checking that it's indeed quoting
a lambda.

* lisp/emacs-lisp/pcase.el: Don't use destructuring-bind.
(pcase--memoize): Rename from pcase-memoize.  Change weakness.
(pcase): Add `let' pattern.
Change memoization so it actually works.
(pcase-mutually-exclusive-predicates): Add byte-code-function-p.
(pcase--u1) <guard, pred>: Fix possible shadowing problem.
<let>: New case.

* src/alloc.c (Fmake_symbol): Init new `declared_special' field.

* src/buffer.c (defvar_per_buffer): Set new `declared_special' field.

* src/bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
New byte-codes.
(exec_byte_code): New function extracted from Fbyte_code to handle new
calling convention for byte-code-functions.  Add new byte-codes.

* src/callint.c (Fcall_interactively): Preserve lexical-binding mode for
interactive spec.

* src/doc.c (Fdocumentation, store_function_docstring):
* src/data.c (Finteractive_form): Handle closures.

* src/eval.c (Fsetq): Handle lexical vars.
(Fdefun, Fdefmacro, Ffunction): Make closures when needed.
(Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
(FletX, Flet): Obey lexical binding.
(Fcommandp): Handle closures.
(Feval): New `lexical' arg.
(eval_sub): New function extracted from Feval.  Use it almost
everywhere where Feval was used.  Look up vars in lexical env.
Handle closures.
(Ffunctionp): Move from subr.el.
(Ffuncall): Handle closures.
(apply_lambda): Remove `eval_flags'.
(funcall_lambda): Handle closures and new byte-code-functions.
(Fspecial_variable_p): New function.
(syms_of_eval): Initialize the Vinternal_interpreter_environment var,
but without exporting it to Lisp.

* src/fns.c (concat, mapcar1): Accept byte-code-functions.

* src/image.c (parse_image_spec): Use Ffunctionp.

* src/keyboard.c (eval_dyn): New fun.
(menu_item_eval_property): Use it.

* src/lisp.h (struct Lisp_Symbol): New field `declared_special'.

* src/lread.c (lisp_file_lexically_bound_p): New function.
(Fload): Bind Qlexical_binding.
(readevalloop): Remove `evalfun' arg.
Bind Qinternal_interpreter_environment.
(Feval_buffer): Bind Qlexical_binding.
(defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
Mark as dynamic.
(syms_of_lread): Declare `lexical-binding'.

* src/window.c (Ftemp_output_buffer_show): New fun.
(Fsave_window_excursion):
* src/print.c (Fwith_output_to_temp_buffer): Move to subr.el.
2011-04-01 13:19:52 -04:00
..
.gitignore (configure, index.texi, vol1.*, vol2.*): Remove. 2008-06-17 05:59:50 +00:00
abbrevs.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
advice.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
anti.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
back.texi Refill some long/short copyright headers. 2011-01-26 00:36:39 -08:00
backups.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
book-spine.texi * doc/lispref/book-spine.texinfo: Rename to book-spine.texi. 2010-10-11 20:52:07 -07:00
buffers.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
ChangeLog Merge from lexical-binding branch. 2011-04-01 13:19:52 -04:00
commands.texi Don't reset post-command-hook to nil upon error. 2011-03-28 16:26:35 -04:00
compile.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
control.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
customize.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
debugging.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
display.texi Merge changes from emacs-23 branch 2011-01-31 18:54:50 -05:00
doclicense.texi Nuke arch-tags. 2011-01-15 15:16:57 -08:00
edebug.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
elisp-covers.texi Refill some long/short copyright headers. 2011-01-26 00:36:39 -08:00
elisp.texi Bump version to 23.3.50 2011-03-11 12:17:33 -05:00
errors.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
eval.texi * doc/lispref/variables.texi (Scope): Mention the availability of lexbind. 2011-03-01 00:03:24 -05:00
files.texi file-truename doc fix for bug#2341. 2011-03-03 00:10:52 -08:00
frames.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
front-cover-1.texi Nuke arch-tags. 2011-01-15 15:16:57 -08:00
functions.texi Get rid of funvec. 2011-02-24 22:27:45 -05:00
gpl.texi Nuke arch-tags. 2011-01-15 15:16:57 -08:00
hash.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
help.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
hooks.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
index.texi (setfilename): Go up one more level to ../../info. 2007-09-06 04:27:43 +00:00
internals.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
intro.texi Allow building manuals with Texinfo before v4.12. 2011-03-09 18:54:08 +02:00
keymaps.texi Merge changes from emacs-23 branch 2011-03-19 14:49:31 -04:00
lay-flat.texi Refill some long/short copyright headers. 2011-01-26 00:36:39 -08:00
lists.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
loading.texi Remove unnecessary manual advice about eval-after-load (Bug#7986). 2011-02-08 19:28:06 -05:00
locals.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
macros.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Makefile.in Convert some names in texinfo files to UTF-8. 2011-03-08 00:59:18 -08:00
makefile.w32-in Allow building manuals with Texinfo before v4.12. 2011-03-09 18:54:08 +02:00
maps.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
markers.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
minibuf.texi * minibuf.texi: Clarify history list discussion (Bug#8085). 2011-02-27 17:10:48 -05:00
modes.texi Fix non-ASCII characters in User and ELisp manuals. 2011-03-10 00:48:33 -05:00
nonascii.texi Merge changes from emacs-23 branch 2011-03-19 14:49:31 -04:00
numbers.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
objects.texi Get rid of funvec. 2011-02-24 22:27:45 -05:00
os.texi format-time-string now supports subsecond time stamp resolution 2011-01-31 23:23:48 -08:00
package.texi Document package archives in the Lisp manual. 2011-03-06 16:52:17 -05:00
positions.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
processes.texi * processes.texi (Synchronous Processes): Minor clarification (Bug#8149). 2011-03-05 15:45:09 -05:00
README Refill some long/short copyright headers. 2011-01-26 00:36:39 -08:00
searching.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
sequences.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
spellfile
streams.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
strings.texi Merge changes from emacs-23 branch 2011-03-19 14:49:31 -04:00
symbols.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
syntax.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
text.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
tindex.pl Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
tips.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
two-volume-cross-refs.txt Refill some long/short copyright headers. 2011-01-26 00:36:39 -08:00
two-volume.make Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
two.el Refill some long/short copyright headers. 2011-01-26 00:36:39 -08:00
variables.texi Miscellanous cleanups in preparation for the merge. 2011-04-01 11:16:50 -04:00
vol1.texi Bump version to 23.3.50 2011-03-11 12:17:33 -05:00
vol2.texi Bump version to 23.3.50 2011-03-11 12:17:33 -05:00
windows.texi Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Copyright (C) 2001-2011  Free Software Foundation, Inc.
See the end of the file for license conditions.


README for Edition 3.0 of the Emacs Lisp Reference Manual.

* This directory contains the texinfo source files for the Emacs Lisp
Reference Manual.

* Report bugs in the Lisp Manual or in Emacs using M-x report-emacs-bug.
To ask questions, use the newsgroup gnu.emacs.help.

* The Emacs Lisp Reference Manual is quite large.  It totals around
1100 pages in smallbook format; the info files total around 3.0 megabytes.

* You can format this manual either for Info or for printing hardcopy
using TeX.

* You can buy nicely printed copies from the Free Software Foundation.
Buying a manual from the Free Software Foundation helps support our GNU
development work.  See <http://shop.fsf.org/>.

* The master file for formatting this manual for Tex is called
`elisp.texi'.  It contains @include commands to include all the
chapters that make up the manual.  In addition, `elisp.texi' has
the title page in a new format designed by Karl Berry, using the
@titlespec command.

* This distribution contains a Makefile that you can use with GNU Make.

** To create a DVI file with a sorted index, run `make elisp.dvi'.

** To make an Info file, you need to install Texinfo, then run `make info'.


This file is part of GNU Emacs.

GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.