Closed kaushalmodi closed 9 years ago
This is great, seems it is what I want. But after test, it does not work for me.
Poporg closing all the windows was the exact reason why I made this commit. It has always worked for me. Can you load poporg from my fork in emacs -Q and check if it works then?
You also need to update the display-buffer-alist
as shown above.
Thank you @kaushalmodi for the pull request. It works great for me, without fiddling with display-buffer-alist
-- what default behavior are you changing exactly?
Thanks for merging the PR.
Without the display-buffer-alist
, the poporg buffer can open in the same window from which I launched poporg; I didn't like that. I'd like to see the original buffer and the poporg buffer side-by-side and thus the display-buffer-alist
tweak.
It just feels smooth to have the original buffer always in view, but probably it's just me :)
Try this out without the display-buffer-alist
tweak:
poporg-dwim
.poporg-dwim
once from the left buffer, quit that and then execute poporg-dwim
from the other buffer.I am curious to know if you too see a similar behavior. :)
Certainly the expected behavior is for the poporg buffer to always open in the other window. This isn't specific to poporg -- anything that runs pop-to-buffer
should behave the same way. I couldn't reproduce the behavior you describe -- I haven't changed any of the display-buffer-*
settings.
@QBobWatson Thanks for the feedback.. time to debug my init then.
@QBobWatson I believe I now know why that problem occurred to me.
Now this discussion has nothing to do with your package.. I am simply brain storming.
I have this function:
;; http://www.whattheemacsd.com/
(defun rotate-windows ()
"Rotate your windows"
(interactive)
(cond ((not (> (count-windows)1))
(message "You can't rotate a single window!"))
(t
(setq i 1)
(setq numWindows (count-windows))
(while (< i numWindows)
(let* (
(w1 (elt (window-list) i))
(w2 (elt (window-list) (+ (% i numWindows) 1)))
(b1 (window-buffer w1))
(b2 (window-buffer w2))
(s1 (window-start w1))
(s2 (window-start w2))
)
(set-window-buffer w1 b2)
(set-window-buffer w2 b1)
(set-window-start w1 s2)
(set-window-start w2 s1)
(setq i (1+ i)))))))
Steps to repeat:
poporg-dwim
once from the left buffer, and then C-x C-s to get back to the main bufferM-x rotate-windows
. Now you should find the other file buffer in the same window (your point stays in the same window as before).poporg-dwim
in the new file buffer (but the same window), poporg will open in the same window.I believe that's because the above function messes up the window-buffer relationship. If I don't use rotate-windows
, things work fine.
@kaushalmodi I still can't reproduce the issue. I'm using Emacs 24.1.1 -- I have a more recent Emacs version at home which I can try tomorrow.
Save/restore window configuration when creating/killing poporg buffer.
This works great with this in my emacs setup: