diff --git a/lisp/uniquify.el b/lisp/uniquify.el index 70e8ecee74..8439d9d874 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -104,6 +104,13 @@ uniquify-buffer-name-style post-forward-angle-brackets name name nil name name<2> +The value can be set to a customized function with two mandatory +arguments. 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." @@ -111,6 +118,7 @@ uniquify-buffer-name-style (const reverse) (const post-forward) (const post-forward-angle-brackets) + (function :tag "Other") (const :tag "numeric suffixes" nil)) :version "24.4" :require 'uniquify) @@ -378,6 +386,8 @@ uniquify-get-proposed-name ((eq uniquify-buffer-name-style 'post-forward-angle-brackets) (concat base "<" (mapconcat 'identity extra-string "/") ">")) + ((functionp uniquify-buffer-name-style) + (funcall uniquify-buffer-name-style base extra-string)) (t (error "Bad value for uniquify-buffer-name-style: %s" uniquify-buffer-name-style)))))