Closed gagbo closed 5 years ago
Seem to complicated, maybe we have another simple way
for example, when in tty, auto run ivy-posframe-mode -1
Is there a hook for whenever you're entering a frame ?
For complete coverage, we'd likely need one on after-make-frame-functions
and focus-in-hook
(or after-focus-change-function
) to check the display device and toggle ivy-posframe-mode accordingly.
However, I prefer the original proposal for this PR because ivy-posframe-mode is global. A daemon user could open a gui and tty frame side by side, and ivy-posframe would be disabled permanently after the first tty frame.
@conao3 any suggestion?
I changed my patch to be cleaner code : an advice which basically takes a predicate and skips the whole advice if false.
Currently hardcoded as (display-graphic-p)
but if this is wrong, anything can be used/customized with slight modifications
merged, thanks!
I'm sorry I didn't notice your call by GitHub notification. I'm glad this problem has been solved.
This added check allows to run ivy-posframe in tty and gui emacs during the same session/with the same server.
I think it's not the cleanest way to do it, but I tested it locally (on MacOS) and that works for me at least (aka, same emacs server, I get posframes in gui emacs and classic minibuffer in tty).
Maybe advising the
ivy-posframe-advice-alist
is the way to go cleaner, I just wanted to propose a change to start with