-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could dedicated popup windows be a thing? #46
Comments
This shouldn't be happening, might be a bug. What is your value of |
The value is I took some time to dig around and here is what I can reproduce with: (progn
(require 'package)
(package-initialize)
(require 'magit)
(setq-default magit-display-buffer-function 'magit-display-buffer-same-window-except-diff-v1)
(define-key magit-file-section-map (kbd "RET") #'magit-diff-visit-file-other-window)
(define-key magit-hunk-section-map (kbd "RET") #'magit-diff-visit-file-other-window)
(require 'popper)
(setq-default popper-reference-buffers `(,(rx bos "*Messages*" eos)))
(popper-mode)
(require 'shackle)
(setq-default shackle-rules `(("*Messages*" :align below :popup t)))
(shackle-mode)
(advice-add 'shackle--display-buffer-aligned-window :after
(defun me/shackle-set-window-side (_buffer _alist plist)
"Set window side parameter for `shackle-last-window' according to PLIST.
This allows other features to filter or select windows based on their function
ie. a side window."
(with-selected-window shackle-last-window
(when-let ((window shackle-last-window)
(alignment (plist-get plist :align)))
(set-window-parameter window 'window-side t)))))
(toggle-frame-maximized) ; Give more room to reproduce screenshot
(split-window-right)
(magit-status) ; Assume buffer is vc-backed
(view-echo-area-messages)) ; Open a popper-managed window
I'm using the The problem described in this issue only happens when running that advice. |
That narrows it down. I'm guessing that the problem is explicitly setting the
Could you try changing it to |
Thanks for looking into it. The advice is meant to tag whatever windows are handled by I'll try your suggestion thanks |
(with-selected-window shackle-last-window
(when-let ((window shackle-last-window)
(alignment (plist-get plist :align)))
- (set-window-parameter window 'window-side t)))))
+ (set-window-parameter window 'window-side alignment))))) Same result ie. visiting a file from the Magit status reuses the bottom popup Edit: apparently the value coming from - (set-window-parameter window 'window-side t)))))
+ (set-window-parameter window 'window-side 'bottom))))) |
Could you paste here all the window parameters of a popup that's misbehaving? ( |
Window parameters for the bottom message buffer as per the test file: Before hitting return to visit a diff file ((internal-region-overlay . #<overlay in no buffer>)
(window-side . bottom)
(quit-restore window window
#<window 3 on magit: emacs>
#<buffer *Messages*>)) After hitting return on a file from the Magit status window: ((internal-region-overlay . #<overlay in no buffer>) (window-side . bottom)
(quit-restore other
(#<buffer *Messages*> 1 #<marker (moves after insertion) at 288 in *Messages*> 31)
#<window 3 on magit: emacs>
#<buffer use-display.el>)) After going back to the message buffer with |
So I realize it might not necessarily be
popper
's responsibility to handle the dedicated behavior but I was wondering how I could cobble that together as a proof of concept without breaking the cycle feature frompopper
.For context, my issue is that with a layout similar to below:
Visiting a file from the Magit status using
magit-diff-visit-file-other-window
sometimes uses my bottom window (undesired). I'm guessing the behavior is reproducible with any-other-window
command. So I was thinking it was only a matter of setting popup windows as dedicated (inpopper-raise-popup
perhaps?) as mentioned above but I fail to see how not to breakpopper-cycle
. Is it something you've worked on/thought about yet?The text was updated successfully, but these errors were encountered: