user option magit-generate-buffer-name-function
The function used to generate the names of Magit buffers.
Such a function should take the options
magit-uniquify-buffer-names as well as
magit-buffer-name-format into account. If it doesn’t, then should be clearly stated in the doc-string. And if it supports %-sequences beyond those mentioned in the doc-string of the option
magit-buffer-name-format, then its own doc-string should describe the additions.
function magit-generate-buffer-name-default-function mode
This function returns a buffer name suitable for a buffer whose major-mode is MODE and which shows information about the repository in which
default-directory is located.
This function uses
magit-buffer-name-format and supporting all of the %-sequences mentioned the documentation of that option. It also respects the option
user option magit-buffer-name-format
The format string used to name Magit buffers.
At least the following %-sequences are supported:
The name of the major-mode, but with the
The value the buffer is locked to, in parentheses, or an empty string if the buffer is not locked to a value.
%v, but the string is prefixed with a space, unless it is an empty string.
The top-level directory of the working tree of the repository, or if
magit-uniquify-buffer-namesis non-nil an abbreviation of that.
magit-uniquify-buffer-namesis nil "*", otherwise the empty string. Due to limitations of the
uniquifypackage, buffer names must end with the path.
Obsolete, use "%t%x" instead. Like
%t, but append an asterisk if and only if
The value should always contain
%t (or the obsolete
magit-uniquify-buffer-names is non-nil, then the value must end with
%t%x (or the obsolete
%T). See issue #2841.
user option magit-uniquify-buffer-names
This option controls whether the names of Magit buffers are uniquified. If the names are not being uniquified, then they contain the full path of the top-level of the working tree of the corresponding repository. If they are being uniquified, then they end with the basename of the top-level, or if that would conflict with the name used for other buffers, then the names of all these buffers are adjusted until they no longer conflict.
This is done using the
uniquify package; customize its options to control how buffer names are uniquified.