Extension answer Tomas.
There are other uniquify-buffer-name-style options besides forward that you might consider:
The files / foo / bar / mumble / name and / baz / quux / mumble / name will have the following buffer names in different 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>
If you want to remove the general suffixes of the conflicting file directory, add the line below to the init emacs file.
(setq uniquify-strip-common-suffix t)
Now, if you open / a 1 / b / c / d and / a2 / b / c / d, the buffer names will say "d | a1" and "d | a2" instead of "d | a1 / b / c" and " d | a2 / b / c ".
source share