nex3 / perspective-el

Perspectives for Emacs.
MIT License
880 stars 71 forks source link

function to add buffer to persp other than current persp #205

Closed titibandit closed 5 months ago

titibandit commented 5 months ago

Actually to address the problem mentioned in issue #50 (add erc buffers to the perspective), I was trying to modify my erc configuration accordingly. As noted there, the persp-add-buffer need to be called. This adds a given buffer to the current perspective.

As erc creates the buffer only the a connection to a channel is established, I might have already moved perspective during the time needed to establish the connection, so the current perspective is not the one I want to add that buffer to anymore. It seems there is no function like (persp-add-buffer persp-name), where one can specify to which perspective a buffer need to be added to. Or am I missing it? Maybe it would make sense for these cases to have the function (persp-add-buffer &optional persp-name)?

gcv commented 5 months ago

We have a with-perspective macro. Would that work for you?

titibandit commented 5 months ago

This absolutely works. Thanks. That makes the integration with the erc irc client pretty neat actually.