* lisp/emacs-lisp/byte-run.el (defmacro, defun): Move from C.

(macro-declaration-function): Move var from C code.
(macro-declaration-function): Define function with defalias.
* lisp/emacs-lisp/macroexp.el (macroexpand-all-1):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyse-form):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't handle
defun/defmacro any more.
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-signature):
Provide fallback for unknown arglist.
(byte-compile-arglist-warn): Change calling convention.
(byte-compile-output-file-form): Move print-vars binding.
(byte-compile-output-docform): Simplify accordingly.
(byte-compile-file-form-defun, byte-compile-file-form-defmacro)
(byte-compile-defmacro-declaration): Remove.
(byte-compile-file-form-defmumble): Generalize to defalias.
(byte-compile-output-as-comment): Return byte-positions.
Simplify callers accordingly.
(byte-compile-lambda): Use `assert'.
(byte-compile-defun, byte-compile-defmacro): Remove.
(byte-compile-file-form-defalias):
Use byte-compile-file-form-defmumble.
(byte-compile-defalias-warn): Remove.
* src/eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
Move to byte-run.el.
(Fautoload): Do the hash-doc more carefully.
* src/data.c (Fdefalias): Purify definition, except for keymaps.
(Qdefun): Move from eval.c.
* src/lisp.h (Qdefun): Remove.
* src/lread.c (read1): Tiny simplification.
* lib-src/make-docfile.c: Improve comment style.
(search_lisp_doc_at_eol): New function.
(scan_lisp_file): Use it.
This commit is contained in:
Stefan Monnier 2012-05-29 23:59:42 -04:00
parent 934f3f582d
commit 61b108cc62
16 changed files with 487 additions and 592 deletions

View file

@ -73,8 +73,6 @@
;; since afterwards they can because obnoxious (warnings about an "unused
;; variable" should not be emitted when the variable use has simply been
;; optimized away).
;; - turn defun and defmacro into macros (and remove special handling of
;; `declare' afterwards).
;; - let macros specify that some let-bindings come from the same source,
;; so the unused warning takes all uses into account.
;; - let interactive specs return a function to build the args (to stash into
@ -410,20 +408,6 @@ places where they originally did not directly appear."
. ,(mapcar (lambda (form) (cconv-convert form env extend))
forms)))
;defun, defmacro
(`(,(and sym (or `defun `defmacro))
,func ,args . ,body)
(assert (equal body (caar cconv-freevars-alist)))
(assert (null (cdar cconv-freevars-alist)))
(let ((new (cconv--convert-function args body env form)))
(pcase new
(`(function (lambda ,newargs . ,new-body))
(assert (equal args newargs))
`(,sym ,func ,args . ,new-body))
(t (byte-compile-report-error
(format "Internal error in cconv of (%s %s ...)" sym func))))))
;condition-case
(`(condition-case ,var ,protected-form . ,handlers)
(let ((newform (cconv--convert-function
@ -618,15 +602,6 @@ and updates the data stored in ENV."
(dolist (vardata newvars)
(cconv--analyse-use vardata form "variable"))))
; defun special form
(`(,(or `defun `defmacro) ,func ,vrs . ,body-forms)
(when env
(byte-compile-log-warning
(format "Function %S will ignore its context %S"
func (mapcar #'car env))
t :warning))
(cconv--analyse-function vrs body-forms nil form))
(`(function (lambda ,vrs . ,body-forms))
(cconv--analyse-function vrs body-forms env form))