Compile-window on demand - ECB - the Emacs Code Browser
Description: ECB - the Emacs Code Browser

Next: Non-semantic sources, Previous: Working with JDEE, Up: Common use-cases

### 10.12 Displaying the compile-window on demand

If you like displaying all output of compile/grep/etc. an all temp-buffers like *Help*-buffers in an extra compile-window (see Temp- and compile-buffers) but you dislike wasting the space of this compile-window if you are just editing then you can get a compile-window “on demand”. Just do the following:

1. Customize `ecb-compile-window-height` to not nil and save it for future sessions. This gives you an extra compile-window at the bottom.
2. Add the following to your .emacs:

               (add-hook 'ecb-activate-hook
                         (lambda ()
                           (let ((compwin-buffer (ecb-get-compile-window-buffer)))
                           (if (not (and compwin-buffer
                                         (ecb-compilation-buffer-p compwin-buffer)))
                               (ecb-toggle-compile-window -1)))))

   This hides the extra compile-window directly after the start of ECB because there is no need for a compile-window at this moment. But the hiding will not be done if there is a compile-window and if a “compile-buffer” in the sense of `ecb-compilation-buffer-p` is displayed in this compile-window. Without this additional check the compile-window would always be hidden after the ECB-start even when ECB is reactivated after a deactivation by the window-manager-support of ECB (see Window-managers and ECB); but in these cases we want to preserve the state before deactivation as good as possible (see also option `ecb-split-edit-window-after-start`).

This is all you have to do. Now if you run `compile` (or `grep` or other compile-modes) or display temp-buffers like *Help*-buffers then ECB autom. displays the compile-window at the bottom and display the output there.

If you have finished with using the compile- or temp-output (e.g. fixing errors) then you can throw away the compile-window just by `ecb-toggle-compile-window` - ECB will reactivate it autom. before next compilation or help-buffer-display.!