Function: recompile

recompile is an interactive and byte-compiled function defined in compile.el.gz.

Signature

(recompile &optional EDIT-COMMAND)

Documentation

Re-compile the program including the current buffer.

If this is run in a Compilation mode buffer, re-use the arguments from the original use. Otherwise, recompile using compile-command. If the optional argument edit-command is non-nil, the command can be edited.

Probably introduced at or before Emacs version 19.30.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/compile.el.gz
;; run compile with the default command line
(defun recompile (&optional edit-command)
  "Re-compile the program including the current buffer.
If this is run in a Compilation mode buffer, re-use the arguments from the
original use.  Otherwise, recompile using `compile-command'.
If the optional argument `edit-command' is non-nil, the command can be edited."
  (interactive "P")
  (save-some-buffers (not compilation-ask-about-save)
                     compilation-save-buffers-predicate)
  (let ((default-directory (or compilation-directory default-directory))
	(command (eval compile-command)))
    (when edit-command
      (setq command (compilation-read-command (or (car compilation-arguments)
						  command)))
      (if compilation-arguments (setcar compilation-arguments command)))
    (apply #'compilation-start (or compilation-arguments (list command)))))