Next: help-dwim, Previous: re-builder-x, Up: Top
cperl-mode recommend using mode-compile, but I don't like mode-compile. Instead, smart-compile+.el does a good job. But I found it is not easy to customize smart-compile+, because the user variables are separated for a language. So I rewrite it to compile-dwim(again, I like dwim).
Settings for certain file type. A list like which has form (TYPE CONDITION COMPILE-COMMAND RUN-COMMAND EXE-FILE).
TYPE is the language type to distinguish from others.
CONDITION is a list of predicates constituted by operator “or”. The predicates can be (name . REGEXP) or (mode . MAJOR-MODE) to test the file name match REGEXP or major-mode eq MAJOR-MODE.
In COMPILE-COMMAND and RUN-COMMAND, these format specifications are available:
%i interpreter name %F absolute pathname %f file name without directory %n file name without extention %e extention of file nameThe interpreter is the program in the shebang line. If the program is valid(test with `executable-find'), then use this program, otherwise, use interpreter in `interpreter-mode-alist' according to the major mode.
EXE-FILE control whether should run compile command before actual run or should recompile again because EXE-FILE is older than source file. Usually, script language don't need to set EXE-FILE.