diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-13 18:31:49 -0400 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-13 18:31:49 -0400 |
| commit | 23aba0ea0e4922cfd8534f43667d3a758f2d2974 (patch) | |
| tree | 798c1de793ca32e93da9edac4705bcdb93aeecc7 /lisp | |
| parent | 2ec42da9f0ddaaa9197617eb3e5a9d18ad2ba942 (diff) | |
| download | emacs-23aba0ea0e4922cfd8534f43667d3a758f2d2974.tar.gz | |
* src/eval.c (Ffunction): Use simpler format for closures.
(Fcommandp, funcall_lambda):
* src/doc.c (Fdocumentation, store_function_docstring):
* src/data.c (Finteractive_form):
* lisp/help-fns.el (help-function-arglist):
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
* lisp/subr.el (apply-partially): Adjust to new closure format.
* lisp/emacs-lisp/disass.el (disassemble-internal): Catch closures.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/disass.el | 3 | ||||
| -rw-r--r-- | lisp/help-fns.el | 3 | ||||
| -rw-r--r-- | lisp/subr.el | 2 |
5 files changed, 11 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 01571b80124..3b93d4ecee7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2011-03-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * help-fns.el (help-function-arglist): + * emacs-lisp/bytecomp.el (byte-compile-arglist-warn): + * subr.el (apply-partially): Adjust to new format. + * emacs-lisp/disass.el (disassemble-internal): Catch closures. + 2011-03-12 Stefan Monnier <monnier@iro.umontreal.ca> * subr.el (apply-partially): Move from subr.el; don't use lexical-let. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 729d91eb1c5..69733ed2e8e 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1345,7 +1345,7 @@ extra args." (let ((sig1 (byte-compile-arglist-signature (pcase old (`(lambda ,args . ,_) args) - (`(closure ,_ ,_ ,args . ,_) args) + (`(closure ,_ ,args . ,_) args) ((pred byte-code-function-p) (aref old 0)) (t '(&rest def))))) (sig2 (byte-compile-arglist-signature (nth 2 form)))) diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index 9ee02a98e5e..9318876fe61 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el @@ -86,8 +86,7 @@ redefine OBJECT if it is a symbol." (setq macro t obj (cdr obj))) (when (and (listp obj) (eq (car obj) 'closure)) - (setq lexical-binding t) - (setq obj (cddr obj))) + (error "Don't know how to compile an interpreted closure")) (if (and (listp obj) (eq (car obj) 'byte-code)) (setq obj (list 'lambda nil obj))) (if (and (listp obj) (not (eq (car obj) 'lambda))) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index f81505c1cf1..8209cdebd3c 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -104,8 +104,6 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"." (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def))) ;; If definition is a macro, find the function inside it. (if (eq (car-safe def) 'macro) (setq def (cdr def))) - ;; and do the same for interpreted closures - (if (eq (car-safe def) 'closure) (setq def (cddr def))) (cond ((and (byte-code-function-p def) (integerp (aref def 0))) (let* ((args-desc (aref def 0)) @@ -124,6 +122,7 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"." (nreverse arglist))) ((byte-code-function-p def) (aref def 0)) ((eq (car-safe def) 'lambda) (nth 1 def)) + ((eq (car-safe def) 'closure) (nth 2 def)) ((subrp def) (let ((arity (subr-arity def)) (arglist ())) diff --git a/lisp/subr.el b/lisp/subr.el index 5faaa2130a2..3a32a2f6558 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -124,7 +124,7 @@ ARGS is a list of the first N arguments to pass to FUN. The result is a new function which does the same as FUN, except that the first N arguments are fixed at the values with which this function was called." - `(closure () lambda (&rest args) + `(closure () (&rest args) (apply ',fun ,@(mapcar (lambda (arg) `',arg) args) args))) (if (null (featurep 'cl)) |
