# change-buffer-name(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

change-buffer-name - Change name of current buffer

## SYNOPSIS

n change-buffer-name "buffer-name" (esc C-n)

## DESCRIPTION

change-buffer-name changes the name of the current buffer to buffer-name. Buffer names must be unique as they act as the identity handle. By default the buffer name is derived from the buffer's file name excluding the path. This can lead to conflicts, when editing files with the same name and different paths, in which case a counter is appended to the end of the buffer name to make the name unique. For example:

    File Name               Buffer Name

    /etc/file.c             file.c
    /tmp/file.c             file.c<1>

The numeric argument n is a bit-mask and is interpreted as follows:

`0x01`

By default, or an argument is specified with bit 1 set, change-buffer-name fails if a buffer with the given name already exists. This behavior can be changed by specifying an argument with the first bit cleared, e.g. 0, in which case if a buffer with that name already exists then a counter as appended.

`0x02`

Forces the buffer to adopt the given name buffer-name, changing the name of any existing buffer if required.

## SEE ALSO

$buffer-fname(5), change-file-name(2), delete-buffer(2).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>