Function: byte-compile-file-form-autoload

byte-compile-file-form-autoload is a byte-compiled function defined in bytecomp.el.gz.

Signature

(byte-compile-file-form-autoload FORM)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/bytecomp.el.gz
(defun byte-compile-file-form-autoload (form)
  (and (let ((form form))
	 (while (if (setq form (cdr form)) (macroexp-const-p (car form))))
	 (null form))                        ;Constants only
       (memq (eval (nth 5 form)) '(t macro)) ;Macro
       (eval form))                          ;Define the autoload.
  ;; Avoid undefined function warnings for the autoload.
  (pcase (nth 1 form)
    (`',(and (pred symbolp) funsym)
     ;; Don't add it if it's already defined.  Otherwise, it might
     ;; hide the actual definition.  However, do remove any entry from
     ;; byte-compile-noruntime-functions, in case we have an autoload
     ;; of foo-func following an (eval-when-compile (require 'foo)).
     (unless (fboundp funsym)
       (push (cons funsym (cons 'autoload (cdr (cdr form))))
             byte-compile-function-environment))
     ;; If an autoload occurs _before_ the first call to a function,
     ;; byte-compile-callargs-warn does not add an entry to
     ;; byte-compile-unresolved-functions.  Here we mimic the logic
     ;; of byte-compile-callargs-warn so as not to warn if the
     ;; autoload comes _after_ the function call.
     ;; Alternatively, similar logic could go in
     ;; byte-compile-warn-about-unresolved-functions.
     (if (memq funsym byte-compile-noruntime-functions)
         (setq byte-compile-noruntime-functions
               (delq funsym byte-compile-noruntime-functions))
       (setq byte-compile-unresolved-functions
             (delq (assq funsym byte-compile-unresolved-functions)
                   byte-compile-unresolved-functions)))))
  (if (stringp (nth 3 form))
      (prog1
          form
        (byte-compile-docstring-style-warn form))
    ;; No doc string, so we can compile this as a normal form.
    (byte-compile-keep-pending form 'byte-compile-normal-call)))