1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-12 00:50:43 -08:00

(byte-compile, byte-compile-keep-pending)

(byte-compile-file-form-defmumble): Generate define-function
rather than fset, to install definitions for defun, defmacro, etc.
This commit is contained in:
Richard M. Stallman 1993-04-17 01:26:24 +00:00
parent 2b86d62c8f
commit 6101b31fb0

View file

@ -1334,8 +1334,8 @@ With argument, insert value in current buffer after the form."
;; writes the given form to the output buffer, being careful of docstrings ;; writes the given form to the output buffer, being careful of docstrings
;; in defun, defmacro, defvar, defconst and autoload because make-docfile is ;; in defun, defmacro, defvar, defconst and autoload because make-docfile is
;; so amazingly stupid. ;; so amazingly stupid.
;; fset's are output directly by byte-compile-file-form-defmumble; it does ;; define-functions are output directly by byte-compile-file-form-defmumble; it does
;; not pay to first build the fset in defmumble and then parse it here. ;; not pay to first build the define-function in defmumble and then parse it here.
(if (and (memq (car-safe form) '(defun defmacro defvar defconst autoload)) (if (and (memq (car-safe form) '(defun defmacro defvar defconst autoload))
(stringp (nth 3 form))) (stringp (nth 3 form)))
(byte-compile-output-docform '("\n(" 3 ")") form) (byte-compile-output-docform '("\n(" 3 ")") form)
@ -1376,7 +1376,7 @@ With argument, insert value in current buffer after the form."
(let ((for-effect t)) (let ((for-effect t))
;; To avoid consing up monstrously large forms at load time, we split ;; To avoid consing up monstrously large forms at load time, we split
;; the output regularly. ;; the output regularly.
(and (eq (car-safe form) 'fset) (nthcdr 300 byte-compile-output) (and (eq (car-safe form) 'define-function) (nthcdr 300 byte-compile-output)
(byte-compile-flush-pending)) (byte-compile-flush-pending))
(funcall handler form) (funcall handler form)
(if for-effect (if for-effect
@ -1569,9 +1569,9 @@ With argument, insert value in current buffer after the form."
new-one))))) new-one)))))
'byte-compile-two-args) 'byte-compile-two-args)
;; Output the form by hand, that's much simpler than having ;; Output the form by hand, that's much simpler than having
;; b-c-output-file-form analyze the fset. ;; b-c-output-file-form analyze the define-function.
(byte-compile-flush-pending) (byte-compile-flush-pending)
(princ "\n(fset '" outbuffer) (princ "\n(define-function '" outbuffer)
(prin1 name outbuffer) (prin1 name outbuffer)
(byte-compile-output-docform (byte-compile-output-docform
(cond ((atom code) (cond ((atom code)
@ -1602,7 +1602,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
(cons 'macro (byte-compile-lambda fun)) (cons 'macro (byte-compile-lambda fun))
(byte-compile-lambda fun))) (byte-compile-lambda fun)))
(if (symbolp form) (if (symbolp form)
(fset form fun) (define-function form fun)
fun))))))) fun)))))))
(defun byte-compile-sexp (sexp) (defun byte-compile-sexp (sexp)