emacs-purpose
emacs-purpose copied to clipboard
New display action: split-similar
Might be a good idea to write a split-similar display action. split-similar will look for an existing window with same purpose as the buffer to display, and split that window to display the buffer. "similar" here means "has the same purpose".
Example: let's say imenu-list and neotree are configured as "left-side" windows, and the frame looks like this:
+-------+------------------+
| | |
| neo | |
| tree | edit window |
| | |
| | |
| +------------------+
| | |
| | help window |
+-------+------------------+
Now we use split-similar to display imenu-list:
--------+------------------+
| | |
| neo | |
| tree | edit window |
| | |
+-------+ |
| imenu +------------------+
| list | |
| | help window |
+-------+------------------+
Since neotree has the same purpose as imenu-list, neotree's window is split and imenu-list is displayed in the bottom split.