bytecomp changes
authorRobin Templeton <robin@terpri.org>
Sun, 22 Jun 2014 04:42:29 +0000 (00:42 -0400)
committerRobin Templeton <robin@terpri.org>
Mon, 20 Apr 2015 04:29:01 +0000 (00:29 -0400)
lisp/emacs-lisp/bytecomp.el

index 9c52cc4..43742c2 100644 (file)
@@ -2542,41 +2542,7 @@ FUN should be either a `lambda' value or a `closure' value."
 (defun byte-compile (form)
   "If FORM is a symbol, byte-compile its function definition.
 If FORM is a lambda or a macro, byte-compile it as a function."
-  (displaying-byte-compile-warnings
-   (byte-compile-close-variables
-    (let* ((lexical-binding lexical-binding)
-           (fun (if (symbolp form)
-                   (symbol-function form)
-                 form))
-          (macro (eq (car-safe fun) 'macro)))
-      (if macro
-         (setq fun (cdr fun)))
-      (cond
-       ;; Up until Emacs-24.1, byte-compile silently did nothing when asked to
-       ;; compile something invalid.  So let's tune down the complaint from an
-       ;; error to a simple message for the known case where signaling an error
-       ;; causes problems.
-       ((byte-code-function-p fun)
-        (message "Function %s is already compiled"
-                 (if (symbolp form) form "provided"))
-        fun)
-       (t
-        (when (symbolp form)
-          (unless (memq (car-safe fun) '(closure lambda))
-            (error "Don't know how to compile %S" fun))
-          (setq lexical-binding (eq (car fun) 'closure))
-          (setq fun (byte-compile--reify-function fun)))
-        (unless (eq (car-safe fun) 'lambda)
-          (error "Don't know how to compile %S" fun))
-        ;; Expand macros.
-        (setq fun (byte-compile-preprocess fun))
-        ;; Get rid of the `function' quote added by the `lambda' macro.
-        (if (eq (car-safe fun) 'function) (setq fun (cadr fun)))
-        (setq fun (byte-compile-lambda fun))
-        (if macro (push 'macro fun))
-        (if (symbolp form)
-            (fset form fun)
-          fun)))))))
+  form)
 
 (defun byte-compile-sexp (sexp)
   "Compile and return SEXP."
@@ -4779,28 +4745,6 @@ and corresponding effects."
              (insert (int-to-string n) "\n")))
        (setq i (1+ i))))))
 \f
-;; To avoid "lisp nesting exceeds max-lisp-eval-depth" when bytecomp compiles
-;; itself, compile some of its most used recursive functions (at load time).
-;;
-(eval-when-compile
-  (or (byte-code-function-p (symbol-function 'byte-compile-form))
-      (assq 'byte-code (symbol-function 'byte-compile-form))
-      (let ((byte-optimize nil)                ; do it fast
-           (byte-compile-warnings nil))
-       (mapc (lambda (x)
-               (or noninteractive (message "compiling %s..." x))
-               (byte-compile x)
-               (or noninteractive (message "compiling %s...done" x)))
-             '(byte-compile-normal-call
-               byte-compile-form
-               byte-compile-body
-               ;; Inserted some more than necessary, to speed it up.
-               byte-compile-top-level
-               byte-compile-out-toplevel
-               byte-compile-constant
-               byte-compile-variable-ref))))
-  nil)
-
 (run-hooks 'bytecomp-load-hook)
 
 ;;; bytecomp.el ends here