Function: compilation-buffer-name

compilation-buffer-name is a byte-compiled function defined in compile.el.gz.

Signature

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

Documentation

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 NAME-OF-MODE major mode, return the name of the current buffer, so that it gets reused. Otherwise, construct a buffer name from NAME-OF-MODE.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/compile.el.gz
(defun 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 NAME-OF-MODE major mode,
return the name of the current buffer, so that it gets reused.
Otherwise, construct a buffer name from NAME-OF-MODE."
  (funcall (or name-function
	       compilation-buffer-name-function
               #'compilation--default-buffer-name)
           name-of-mode))