Function: native-compile

native-compile is an autoloaded and byte-compiled function defined in comp.el.gz.

Signature

(native-compile FUNCTION-OR-FILE &optional OUTPUT)

Documentation

Compile FUNCTION-OR-FILE into native code.

This is the synchronous entry-point for the Emacs Lisp native compiler. FUNCTION-OR-FILE is a function symbol, a form, or the filename of an Emacs Lisp source file. If OUTPUT is non-nil, use it as the filename for the compiled object. If FUNCTION-OR-FILE is a filename, if the compilation was successful return the filename of the compiled object. If FUNCTION-OR-FILE is a function symbol or a form, if the compilation was successful return the compiled function.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/comp.el.gz
;;;###autoload
(defun native-compile (function-or-file &optional output)
  "Compile FUNCTION-OR-FILE into native code.
This is the synchronous entry-point for the Emacs Lisp native
compiler.  FUNCTION-OR-FILE is a function symbol, a form, or the
filename of an Emacs Lisp source file.  If OUTPUT is non-nil, use
it as the filename for the compiled object.  If FUNCTION-OR-FILE
is a filename, if the compilation was successful return the
filename of the compiled object.  If FUNCTION-OR-FILE is a
function symbol or a form, if the compilation was successful
return the compiled function."
  (declare (ftype (function ((or string symbol) &optional string)
                            (or native-comp-function string))))
  (comp--native-compile function-or-file nil output))