make to work with uniquify.el

because uniquify.el change the (buffer-name) result.
make some change to get correct extension