Emacs compilation-mode enhancements.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Campbell Barton 6d98cf908b Add fancy-compilation-setup-hook 2 weeks ago
.elisp-autofmt Initial version. 3 weeks ago
LICENSE Initial version. 3 weeks ago
fancy-compilation.el Add fancy-compilation-setup-hook 2 weeks ago
readme.rst Add fancy-compilation-setup-hook 2 weeks ago


Fancy Compilation

This is a minimalist package that enhances compilation-mode in the following ways.

  • Support color output.
  • Support progress updates on a single line (as used by ninja, sphinx and many other build systems).
  • Use scrolling behavior similar to most terminals.
  • Optionally use foreground & background independent of theme colors.

Available via melpa.


There are some limitations with compilation output that I found make it less usable than building from a terminal.

  • No color output from the compilers diagnostics.
  • No support for printing text progress on a single line which works well to avoid the output being flooded by files that were compiled, making it easier to miss important warnings.

While this may seem small - improved diagnostics to help identifying an error and reducing the risk of missing a warning make them both valuable features. This package was written to conveniently support these as well as other minor quality of life features in Emacs.


Once fancy-compilation-mode is enabled, calling compile will use enhancements from this package.


fancy-compilation-term: "tmux-256color"

The TERM environment variable to use (set to an empty string to leave unset).

fancy-compilation-override-colors: t

Override faces & colors when enabled.

This is useful in case colors used by the compiler output such as bright yellow that wont read well on a light background for example.

fancy-compilation-quiet-prelude: t

Suppress text such as "Compilation Started" which is otherwise included before compilation output.

fancy-compilation-quiet-prolog: t

Use brief text output when compilation has completed.

fancy-compilation-setup-hook: nil

Hooks run just after the fancy-compilation buffer has been initialized. Use this to set or override defaults.

The following example shows how compilation-scroll-output can be disabled.

(add-hook 'fancy-compilation-setup-hook
  (lambda ()
    (setq compilation-scroll-output nil))))


These faces are used when fancy-compilation-override-colors is enabled.


This face is used for the primary foreground and background (defaulting to grey on a black background).


Face used to replace font-lock-function-name-face.


Face used to replace compilation-line-number.


Face used to replace compilation-column-number.


Face used to replace compilation-info.


Face used to replace compilation-warning.


Face used to replace compilation-error.


Face used to show completion success.


Face used to show completion failure.


The package is available in melpa as fancy-compilation, here is an example with use-package:

(use-package fancy-compilation
  :commands (fancy-compilation-mode))

(with-eval-after-load 'compile


Since tools that output to the compilation buffer wont recognize it as a TTY, you may need to force color output.


Pass -fdiagnostics-color=always, typically via (CFLAGS & CXXFLAGS).


Pass -fcolor-diagnostics, typically via (CFLAGS & CXXFLAGS)