[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The compile
command is very rudimentary in its creation of its
compilation command, using "make -k" by default. This package provides an
intelligent replacement for the compile
command. See section `Compilation' in The XEmacs Editor., for details.
The mode-compile
command functions as a layer above compile
.
Its purpose is mainly to build a smarter compile command for compile
to execute. This compile command is built according to number of parameters:
buffer-file-name
and extension
Most of these parameters are highly customizable through Emacs Lisp variables
(to be set in your user-init-file
or through the Customization menu).
Running mode-compile
after a universal-argument (C-u) allows
remote compilations; the user is prompted for the host name to execute the
compilation command. The mode-compile-kill
function terminates a
running compilation session launched by mode-compile
.
By default, mode-compile
is very verbose and waits a user-specified
number of seconds after displaying each message to give the user time to read
it. The variables mode-compile-expert-p
and
mode-compile-reading-time
can be used to change this behaviour. On
Windows-based systems, the variable mode-compile-other-frame-p
will
create a new frame and launch the compilation command in it.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section explains how the compile-command
is built according
to the major-mode
and how to customize it. The major modes currently
supported are:
ada-mode | c++-mode | c-mode |
c?perl-mode | compilation-mode | csh-mode |
dired-mode | emacs-lisp-mode | fortran-mode |
fundamental-mode | indented-text-mode | java-mode |
lisp-interaction-mode | makefile-mode | python-mode |
sh-mode | tcl-mode | text-mode |
zsh-mode |
For other modes a default behaviour is provided.
When running mode-compile
or mode-compile-kill
the hooks
mode-compile-(before|after)-(compile|kill)-hook
are executed. The
current buffer can be automatically saved if
mode-compile-always-save-buffer-p
is set to t
. All the
modified buffers can be automatically saved if mode-compile-save-all-p
is set to t
.
To configure this package, type:
M-x customize-group RET compilation RET |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Calls compile
with the last compile command.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The makefile is run with make through compile
(user is prompted for
the rule to run, see variable mode-compile-preferred-default-makerule
to see how a default choice could be selected).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If the buffer is a `.el' file we byte-compile
it to produce a
`.elc' file. Otherwise, just byte-compile
the buffer (this does
not use compile
but byte-compile
).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Find a `makefile' in the directory and run make with it (like in
makefile-mode
), else try to byte-recompile
all `.el' files
older than their associated `.elc' files (unlike
byte-recompile-directory
this is not recursive), finally if no
`.el' files are present ask compilation command to user by calling
default-compile
. To find a `makefile' a regexp is provided which
name is mode-compile-makefile-regexp
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Run "[cz]?sh" with debugging arguments as specified in
[cz]?sh-dbg-flags
on the currently edited file.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Run file with "perl -w" (can step through errors with compile's next-error
command).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Run file with "wish" (can step through errors with compile's
next-error
command).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
First it tries to see if there is a `makefile' in the
directory. Makefiles to look for are specified by the variable
mode-compile-makefile-regexp
. If yes two cases could happen: there is
only one makefile so use it, or there is more than one (sometimes when you
need to write portable soft you could have some makefiles by system:
SunOs.make, HP.make ...), in that case prompt to user for choice (with smart
completion). Once the makefile has been selected it extract the rules from
it and ask to user to choose a rule to make (with smart completion, see
variable mode-compile-preferred-default-makerule
to see how a default
choice could be selected).
There are some cases where no makefiles are present (YES I KNOW this is bad
practice but you sometimes have no need to write a Makefile). In that case
the function tries to build the most intelligent compilation command by using
the favourite user C/C++ compiler: value of environment variable "CC" or
"CXX" or first found, in the PATH, of compilers specified in variable
cc-compilers-list
or c++-compilers-list
. Then it looks for the
environment variable "CFLAGS" of "CXXFLAGS" to append to the compiler command,
finds the file to compile: <name-of-the-file-to-compiled>.(c|cc|C|cpp) (see *)
and asks for confirmation. If you really trust mode-compile will build the
correct command and want to bypass confirmation you could set the variable
mode-compile-never-edit-command-p
to t
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Same as c/c++-mode but run Ada compiler on the Ada file. There are no companion file and no way to find a main function in Ada.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Same as c-mode but run Fortran compiler on .[Ff](or)? files.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Same as c-mode but call "javac" without the -o option on .java files
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Run file with "python" (can step through errors with compile's
next-error
command).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Run message-send
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This handles fundamental-mode
, text-mode
,
indented-text-mode
and any unknown modes.
Try to guess what the file is by
mode-compile-filename-regexp-alist
).
mode-compile-shell-alist
).
compile
with the last compile command which is asked to
be edited by user
The kill-compile
command is then bound dynamically (buffer-local).
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by XEmacs shared group account on December, 19 2009
using texi2html 1.65.