bmag / emacs-purpose

Manage Windows and Buffers According to Purposes
GNU General Public License v3.0
496 stars 23 forks source link

Question: Trying to work out how to configure purpose-mode #136

Closed Eearslya closed 5 years ago

Eearslya commented 6 years ago

I just got started using spacemacs a month or so ago, and I've fallen in love with using it as an IDE. I found that purpose-mode was the answer to my 'keep windows dedicated to x and y' prayers. But I'm having an issue with trying to get everything to behave.

I'm doing Ruby on Rails development in emacs, so two buffers that I end up using a lot are bundler (named *Bundler*), and RSpec (major mode rspec-compilation-mode). I've assigned both of these buffers to a commands purpose using customize-group, which made this code:

(custom-set-variables
 '(purpose-mode t)
 '(purpose-user-mode-purposes
   (quote
    ((rspec-compilation-mode . commands)
     (compilation-mode . commands))))
 '(purpose-user-name-purposes (quote (("*Bundler*" . commands) ("Bundler" . commands)))))

I verified that purpose--user-mode-purposes and purpose--user-name-purposes were updated properly.

Bundler is technically a shell-mode buffer, and RSpec is a compilation-mode buffer with its own custom major mode (it's run using the compile function, at least..)

However, after creating a window and giving it the commands purpose, running either of those commands will still create a brand new window at the bottom of the screen. The strangest part about it is, if I go back to the commands purpose buffer and use purpose-switch-buffer-with-purpose, they actually show up in the list of buffers. So, somehow, purpose-mode knows that they should be commands buffers, but they're not using the assigned window for them...

bmag commented 5 years ago

Hey @Eearslya, sorry for the delay. Can I get some more info?

How buffers are displayed depends on the commands used, and Spacemacs config might also interfere, but with these details I should be able to figure out what's going on.

Eearslya commented 5 years ago

Well, it seems like it was something to do with Spacemacs, after all. Just yesterday, I decided Spacemacs was a bit too arcane and restricting, so I started to roll my own personal configuration. After getting settled in with this new configuration, I can happily say that purpose-mode works perfectly with everything I've thrown at it.

Thanks so much for your response, but it seems like it's some strange interaction between Spacemacs and purpose mode.. I suspect it has something to do with the fact that RSpec and Bundler were considered "popup" windows. I had some success getting them to choose the correct window if I set a window to the "popup" purpose.. But, all is well now.