compilation-buffer-name

compilation-buffer-name is a compiled Lisp function in `compile.el'.

(compilation-buffer-name NAME-OF-MODE MODE-COMMAND NAME-FUNCTION)

Return the name of a compilation buffer to use.
If NAME-FUNCTION is non-nil, call it with one argument NAME-OF-MODE
to determine the buffer name.
Likewise if `compilation-buffer-name-function' is non-nil.
If current buffer has the major mode MODE-COMMAND,
return the name of the current buffer, so that it gets reused.
Otherwise, construct a buffer name from NAME-OF-MODE.