Zamansky 36: Swapping Buffers and Some Elisp

Mike Zamansky has another video up. This time, it’s about swapping buffers but keeping focus in the original window. The video is interesting because it shows the process Zamansky went through to solve a problem he was having.

The problem was that he had a window configuration with one large buffer and two smaller ones. He wanted to swap the buffer in one of the smaller windows with the one in large window. If you have ace-window installed, it’s easy to swap two windows. I have the proper call in a hydra and use it reasonably often.

The problem with that for Zamansky is that he’s trying to move another buffer into the large window so he can work on it but ace-window keeps the focus with the original buffer so it’s in the wrong window. What he needed was to swap the buffers but keep the focus in the original window.

Most of the video is how he solved this problem with a bit of Elisp and how he felt his way to the solution by using the Emacs help system and by looking at the ace-window code. It’s an instructive video especially if you have only minimal Elisp skills. Zamansky shows that you don’t need to be an expert to solve real problems.

Even if you already use ace-window, the video may teach you something you didn’t know. It did me. It turns out that after calling ace-window to change to a new window, you can give it a subcommand instead of a window number. That makes it easy to swap windows and do certain other actions. See the video for the details.

The video is a little over 12 and a half minutes so it should be easy to find time for it. As with all of Zamansky’s videos, it’s well worth your time.

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