Cloning Buffers

Mickey Petersen tweets about cloning buffers and makes explicit a distinction that I must admit I wasn’t clear on.

I’m pretty familiar with indirect buffers, which are a clever way of looking at a buffer with two different views: you can have different narrowings, point positions, modes, and other properties while still maintaining identical text. Text changes made to the indirect buffer or the base buffer are instantly reflected in the other. It’s almost always what you want but sometimes it’s convenient to simply make an independent copy of a buffer.

Mickey’s tweet shows you how to do either. Oddly, I couldn’t find clone-buffer in the manual but its documentation available with describe-function (Ctrl+h f) and has been around for a long time.

As I said, you almost always want clone-indirect-buffer or its siblings. I’ve used it a few times but I’ve never used clone-buffer. Still, it’s nice to know they’re both available. As usual, Emacs has us covered.

This entry was posted in General and tagged . Bookmark the permalink.