Mercurial > emacs
comparison lisp/emacs-lisp/bytecomp.el @ 2566:4f201a4ab030
(define-function): Changed name back to defalisaases to get things in
a known-good state.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Fri, 23 Apr 1993 03:43:33 +0000 |
parents | ec2eb7c5a2da |
children | 7ff77992fca0 |
comparison
equal
deleted
inserted
replaced
2565:c1a1557bffde | 2566:4f201a4ab030 |
---|---|
1332 | 1332 |
1333 (defun byte-compile-output-file-form (form) | 1333 (defun byte-compile-output-file-form (form) |
1334 ;; writes the given form to the output buffer, being careful of docstrings | 1334 ;; writes the given form to the output buffer, being careful of docstrings |
1335 ;; in defun, defmacro, defvar, defconst and autoload because make-docfile is | 1335 ;; in defun, defmacro, defvar, defconst and autoload because make-docfile is |
1336 ;; so amazingly stupid. | 1336 ;; so amazingly stupid. |
1337 ;; define-functions are output directly by byte-compile-file-form-defmumble; it does | 1337 ;; defalias calls are output directly by byte-compile-file-form-defmumble; |
1338 ;; not pay to first build the define-function in defmumble and then parse it here. | 1338 ;; it does not pay to first build the defalias in defmumble and then parse |
1339 ;; it here. | |
1339 (if (and (memq (car-safe form) '(defun defmacro defvar defconst autoload)) | 1340 (if (and (memq (car-safe form) '(defun defmacro defvar defconst autoload)) |
1340 (stringp (nth 3 form))) | 1341 (stringp (nth 3 form))) |
1341 (byte-compile-output-docform '("\n(" 3 ")") form) | 1342 (byte-compile-output-docform '("\n(" 3 ")") form) |
1342 (let ((print-escape-newlines t) | 1343 (let ((print-escape-newlines t) |
1343 (print-readably t) ; print #[] for bytecode, 'x for (quote x) | 1344 (print-readably t) ; print #[] for bytecode, 'x for (quote x) |
1374 (setq form (byte-optimize-form form t))) | 1375 (setq form (byte-optimize-form form t))) |
1375 (if handler | 1376 (if handler |
1376 (let ((for-effect t)) | 1377 (let ((for-effect t)) |
1377 ;; To avoid consing up monstrously large forms at load time, we split | 1378 ;; To avoid consing up monstrously large forms at load time, we split |
1378 ;; the output regularly. | 1379 ;; the output regularly. |
1379 (and (eq (car-safe form) 'define-function) (nthcdr 300 byte-compile-output) | 1380 (and (eq (car-safe form) 'defalias) (nthcdr 300 byte-compile-output) |
1380 (byte-compile-flush-pending)) | 1381 (byte-compile-flush-pending)) |
1381 (funcall handler form) | 1382 (funcall handler form) |
1382 (if for-effect | 1383 (if for-effect |
1383 (byte-compile-discard))) | 1384 (byte-compile-discard))) |
1384 (byte-compile-form form t)) | 1385 (byte-compile-form form t)) |
1567 ((list 'quote (if macrop | 1568 ((list 'quote (if macrop |
1568 (cons 'macro new-one) | 1569 (cons 'macro new-one) |
1569 new-one))))) | 1570 new-one))))) |
1570 'byte-compile-two-args) | 1571 'byte-compile-two-args) |
1571 ;; Output the form by hand, that's much simpler than having | 1572 ;; Output the form by hand, that's much simpler than having |
1572 ;; b-c-output-file-form analyze the define-function. | 1573 ;; b-c-output-file-form analyze the defalias. |
1573 (byte-compile-flush-pending) | 1574 (byte-compile-flush-pending) |
1574 (princ "\n(define-function '" outbuffer) | 1575 (princ "\n(defalias '" outbuffer) |
1575 (prin1 name outbuffer) | 1576 (prin1 name outbuffer) |
1576 (byte-compile-output-docform | 1577 (byte-compile-output-docform |
1577 (cond ((atom code) | 1578 (cond ((atom code) |
1578 (if macrop '(" '(macro . #[" 4 "])") '(" #[" 4 "]"))) | 1579 (if macrop '(" '(macro . #[" 4 "])") '(" #[" 4 "]"))) |
1579 ((eq (car code) 'quote) | 1580 ((eq (car code) 'quote) |
1600 (cond ((eq (car-safe fun) 'lambda) | 1601 (cond ((eq (car-safe fun) 'lambda) |
1601 (setq fun (if macro | 1602 (setq fun (if macro |
1602 (cons 'macro (byte-compile-lambda fun)) | 1603 (cons 'macro (byte-compile-lambda fun)) |
1603 (byte-compile-lambda fun))) | 1604 (byte-compile-lambda fun))) |
1604 (if (symbolp form) | 1605 (if (symbolp form) |
1605 (define-function form fun) | 1606 (defalias form fun) |
1606 fun))))))) | 1607 fun))))))) |
1607 | 1608 |
1608 (defun byte-compile-sexp (sexp) | 1609 (defun byte-compile-sexp (sexp) |
1609 "Compile and return SEXP." | 1610 "Compile and return SEXP." |
1610 (displaying-byte-compile-warnings | 1611 (displaying-byte-compile-warnings |