1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-04 13:03:09 -08:00
emacs/lisp
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
..
calc * calc/calc-menu.el (calc-units-menu): Add entries for logarithmic 2011-03-20 15:59:29 -05:00
calendar Merge changes made in Gnus trunk. 2011-03-18 13:45:04 +00:00
cedet Miscellanous cleanups in preparation for the merge. 2011-04-01 11:16:50 -04:00
emacs-lisp Merge from lexical-binding branch. 2011-04-01 13:19:52 -04:00
emulation
erc
eshell esh-opt trivia. 2011-03-22 19:52:52 -07:00
gnus mm-view.el (mm-display-inline-fontify): Do not fontify with fundamental-mode. 2011-04-01 14:24:22 +00:00
international
language
mail
mh-e
net * net/rcirc.el (rcirc-handler-001): Only authenticate, if there's 2011-03-31 14:19:17 +02:00
nxml
obsolete Move abbrevlist.el to obsolete/abbrevlist.el 2011-03-24 02:11:15 +08:00
org Fix misuse of quote in `case'. 2011-03-15 13:39:56 -04:00
play Fix misuse of quote in `case'. 2011-03-15 13:39:56 -04:00
progmodes * lisp/progmodes/f90.el (f90-find-tag-default): Handle multiple `%'. 2011-03-31 00:20:38 -07:00
term
textmodes Merge from trunk 2011-03-21 12:42:16 -04:00
url
vc Merge from lexical-binding branch. 2011-04-01 13:19:52 -04:00
.gitignore
abbrev.el Merge from trunk 2011-03-31 00:24:03 -04:00
align.el
allout-widgets.el * allout.el (allout-hide-by-annotation, allout-flag-region): Reduce 2011-03-29 14:26:01 -04:00
allout.el * allout.el (allout-hide-by-annotation, allout-flag-region): Reduce 2011-03-29 14:26:01 -04:00
ansi-color.el Support separate fg and bg colors in ansi-color.el 2011-03-27 09:56:35 +08:00
apropos.el
arc-mode.el
array.el
autoarg.el
autoinsert.el
autorevert.el
avoid.el Merge changes from emacs-23 branch 2011-03-19 14:49:31 -04:00
battery.el
bindings.el
bookmark.el
bs.el
buff-menu.el
button.el
calculator.el
case-table.el
cdl.el
ChangeLog Merge from lexical-binding branch. 2011-04-01 13:19:52 -04:00
ChangeLog.1
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
ChangeLog.10
ChangeLog.11
ChangeLog.12
ChangeLog.13
ChangeLog.14
chistory.el
cmuscheme.el
color.el
comint.el First step towards using standard completion in comint. 2011-03-24 18:05:01 -04:00
completion.el
composite.el
COPYING
cus-dep.el
cus-edit.el cus-edit tweak for bug#2298. 2011-03-09 19:44:33 -08:00
cus-face.el
cus-start.el Format doc and add customize for ns-auto-hide-menu-bar. 2011-03-27 12:55:07 +02:00
cus-theme.el Several fixes to cus-theme.el. 2011-03-21 00:30:55 -04:00
custom.el Merge from trunk 2011-03-31 00:24:03 -04:00
dabbrev.el
delim-col.el
delsel.el
descr-text.el
desktop.el
dframe.el
dired-aux.el Add error for dired-create-directory on existing file (Bug#8246). 2011-03-19 18:07:41 -04:00
dired-x.el
dired.el Merge from trunk 2011-03-21 12:42:16 -04:00
dirtrack.el
disp-table.el
dnd.el
doc-view.el
dos-fns.el
dos-vars.el
dos-w32.el
double.el
dynamic-setting.el
ebuff-menu.el Merge from emacs-23; up to 2010-06-03T22:16:02Z!dann@ics.uci.edu 2011-03-12 11:19:47 -08:00
echistory.el
edmacro.el
ehelp.el
electric.el
elide-head.el
emacs-lock.el
env.el
epa-dired.el
epa-file.el
epa-hook.el
epa-mail.el
epa.el
epg-config.el
epg.el
expand.el
ezimage.el
face-remap.el
facemenu.el Fix facemenu to populate buffer inside the with-help-window call. 2011-03-19 17:37:21 -04:00
faces.el
ffap.el
filecache.el
files-x.el
files.el Merge from trunk 2011-03-21 12:42:16 -04:00
filesets.el
find-cmd.el
find-dired.el
find-file.el
find-lisp.el
finder.el
flow-ctrl.el
foldout.el
follow.el
font-core.el
font-lock.el
format-spec.el
format.el
forms-d2.el
forms-pass.el
forms.el
frame.el
fringe.el
generic-x.el * lisp/generic-x.el (etc-fstab-generic-mode): Add ext4, sysfs keywords. 2011-03-30 19:11:34 -07:00
gs.el
help-at-pt.el
help-fns.el Merge from trunk 2011-03-21 12:42:16 -04:00
help-macro.el
help-mode.el Tweak regexp in help-mode-finish 2011-03-23 19:56:34 +08:00
help.el lisp/help.el (describe-mode): Link to the mode's definition. 2011-03-13 02:57:40 +01:00
hex-util.el
hexl.el
hfy-cmap.el
hi-lock.el
hilit-chg.el
hippie-exp.el
hl-line.el
htmlfontify.el
ibuf-ext.el
ibuf-macs.el
ibuffer.el
icomplete.el
ido.el Add to minibuffer-history if HISOTRY is nil in ido.el 2011-03-29 16:25:31 +08:00
ielm.el
iimage.el
image-dired.el
image-file.el
image-mode.el
image.el lisp/image.el: Avoid some warnings. 2011-03-22 14:10:43 +01:00
imenu.el
indent.el
info-look.el
info-xref.el
info.el Add a new command `info-display-manual'. 2011-04-01 13:10:47 +03:00
informat.el
isearch.el
isearchb.el
iswitchb.el
jit-lock.el
jka-cmpr-hook.el
jka-compr.el
json.el
kermit.el
kmacro.el
ldefs-boot.el * lisp/makefile.w32-in (COMPILE_FIRST): Fix up last change. 2011-03-14 22:49:15 -04:00
ledit.el
linum.el
loadhist.el
loadup.el * lisp/loadup.el: Load minibuffer after loaddefs, to use define-minor-mode. 2011-03-31 11:17:06 -04:00
locate.el
longlines.el
lpr.el
ls-lisp.el
macros.el
Makefile.in Miscellanous cleanups in preparation for the merge. 2011-04-01 11:16:50 -04:00
makefile.w32-in lisp/makefile.w32-in (COMPILE_FIRST): Remove pcase. 2011-03-30 16:01:28 +02:00
makesum.el
man.el
master.el
mb-depth.el
md4.el
menu-bar.el
midnight.el Remove redundant (require 'timer) in midnight.el 2011-03-26 06:26:30 +08:00
minibuf-eldef.el
minibuffer.el Merge from lexical-binding branch. 2011-04-01 13:19:52 -04:00
misc.el
misearch.el
mouse-copy.el
mouse-drag.el
mouse-sel.el
mouse.el
mpc.el Misc fixes, and use lexical-binding in more files. 2011-03-11 15:04:22 -05:00
msb.el
mwheel.el
newcomment.el Misc fixes, and use lexical-binding in more files. 2011-03-11 15:04:22 -05:00
notifications.el Fix misuse of quote in `case'. 2011-03-15 13:39:56 -04:00
novice.el
outline.el
paren.el
password-cache.el
patcomp.el
paths.el
pcmpl-cvs.el
pcmpl-gnu.el
pcmpl-linux.el
pcmpl-rpm.el
pcmpl-unix.el
pcomplete.el
printing.el
proced.el
ps-bdf.el
ps-def.el
ps-mule.el
ps-print.el
ps-samp.el
README
recentf.el
rect.el
register.el
repeat.el
replace.el
reposition.el
reveal.el Misc fixes, and use lexical-binding in more files. 2011-03-11 15:04:22 -05:00
rfn-eshadow.el
rot13.el
ruler-mode.el
savehist.el
saveplace.el
sb-image.el
scroll-all.el
scroll-bar.el
scroll-lock.el
select.el
server.el Merge from trunk 2011-03-21 12:42:16 -04:00
ses.el
sha1.el
shadowfile.el
shell.el * shell.el (shell): When called interactively, offer to change the 2011-03-14 10:53:13 +01:00
simple.el Merge from trunk 2011-03-31 00:24:03 -04:00
skeleton.el
sort.el
soundex.el
speedbar.el
startup.el * lisp/subr.el (with-output-to-temp-buffer): Don't change current-buffer to 2011-03-29 23:27:56 -04:00
strokes.el
subr.el Merge from trunk 2011-03-31 00:24:03 -04:00
t-mouse.el
tabify.el
talk.el
tar-mode.el
tempo.el
term.el
terminal.el
thingatpt.el Add support for defun in thingatpt.el 2011-03-25 00:38:12 +08:00
thumbs.el
time-stamp.el
time.el
timezone.el
tmm.el
tool-bar.el
tooltip.el
tree-widget.el
tutorial.el
type-break.el
uniquify.el Misc fixes, and use lexical-binding in more files. 2011-03-11 15:04:22 -05:00
userlock.el
vcursor.el
version.el Bump version to 23.3.50 2011-03-11 12:17:33 -05:00
view.el
vt-control.el
vt100-led.el
w32-fns.el
w32-vars.el
wdired.el
whitespace.el
wid-browse.el
wid-edit.el
widget.el
windmove.el
window.el
winner.el
woman.el
x-dnd.el
xml.el
xt-mouse.el

This directory contains source code for the parts of Emacs that are
written in Emacs Lisp.  *.el files are Emacs Lisp source, and the
corresponding *.elc files are byte-compiled versions.  Byte-compiled
files are architecture-independent.

The term subdirectory contains Lisp files that customize Emacs for
certain terminal types.  When Emacs starts, it checks the TERM
environment variable to get the terminal type and loads
`term/${TERM}.el' if it exists.

The other subdirectories hold Lisp packages grouped by their general
purpose.