Unique buffer names in Emacs

Reading time ~1 minute

A common annoyance with Emacs when working on a code base that has duplicate file names is that the mode line tends to display the buffer names as "one.py:<1>", "one.py:<2>" etc etc. That doesn't help much with telling them apart and I find it confusing.

I was introduced to the Uniquify library a while ago. This library allows you some control over how you want to display the buffer names of buffers that contain files with duplicate names. I use the following configuration in my .emacs:

(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward uniquify-separator ":")

The above code will display duplicate buffers as "one.py:left" and "one.py:right", with "left" and "right" being the directories that contain the file. The screenshot below shows Emacs with two files with the same name opened from two different locations:

SE-Radio interviews Ron Lichty, must listen for development managers

The [Software Engineering Radio](http://www.se-radio.net/) podcast has just published an episode with an interview with Ron Lichty.If you...… Continue reading

Emacs 25.3 released

Published on September 14, 2017