Variable: uniquify-buffer-name-style

uniquify-buffer-name-style is a customizable variable defined in uniquify.el.gz.

Value

post-forward-angle-brackets

Documentation

How to construct unique buffer names for files with the same base name.

The value can be one of: forward, reverse, post-forward, post-forward-angle-brackets, or nil.

For example, the files /foo/bar/mumble/name and /baz/quux/mumble/name would have the following buffer names in the various styles:

  forward bar/mumble/name quux/mumble/name
  reverse name\mumble\bar name\mumble\quux
  post-forward name|bar/mumble name|quux/mumble
  post-forward-angle-brackets name<bar/mumble> name<quux/mumble>
  nil name name<2>

The value can be set to a customized function with two arguments BASE and EXTRA-STRINGS where BASE is a string and EXTRA-STRINGS is a list of strings. For example the current implementation for post-forward-angle-brackets could be:

  (defun my-post-forward-angle-brackets (base extra-string)
    (concat base "<" (mapconcat #'identity extra-string "/") ">"))

The "mumble" part may be stripped as well, depending on the setting of uniquify-strip-common-suffix. For more options that you can set, browse the uniquify custom group.

This variable was added, or its default value changed, in Emacs 24.4.

View in manual

Probably introduced at or before Emacs version 20.1.

Source Code

;; Defined in /usr/src/emacs/lisp/uniquify.el.gz
(defcustom uniquify-buffer-name-style 'post-forward-angle-brackets
  "How to construct unique buffer names for files with the same base name.
The value can be one of: `forward', `reverse', `post-forward',
`post-forward-angle-brackets', or nil.

For example, the files `/foo/bar/mumble/name' and `/baz/quux/mumble/name'
would have the following buffer names in the various styles:

  forward                       bar/mumble/name    quux/mumble/name
  reverse                       name\\mumble\\bar    name\\mumble\\quux
  post-forward                  name|bar/mumble    name|quux/mumble
  post-forward-angle-brackets   name<bar/mumble>   name<quux/mumble>
  nil                           name               name<2>

The value can be set to a customized function with two arguments
BASE and EXTRA-STRINGS where BASE is a string and EXTRA-STRINGS
is a list of strings.  For example the current implementation for
post-forward-angle-brackets could be:

  (defun my-post-forward-angle-brackets (base extra-string)
    (concat base \"<\" (mapconcat #\\='identity extra-string \"/\") \">\"))

The \"mumble\" part may be stripped as well, depending on the
setting of `uniquify-strip-common-suffix'.  For more options that
you can set, browse the `uniquify' custom group."
  :type '(radio (const forward)
		(const reverse)
		(const post-forward)
		(const post-forward-angle-brackets)
                (function :tag "Other")
		(const :tag "numeric suffixes" nil))
  :version "24.4"
  :require 'uniquify)