Skip to content
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

Conflict with mini-frame? #286

Closed
BooAA opened this issue Apr 24, 2021 · 1 comment
Closed

Conflict with mini-frame? #286

BooAA opened this issue Apr 24, 2021 · 1 comment

Comments

@BooAA
Copy link

BooAA commented Apr 24, 2021

When using mini-frame, sometimes calling consult-buffer (or consult-buffer-other-window) makes minibuffer input and candidates disappear.

Version: Emacs28 native-comp commits: 062e599
OS: Debian/Sid
Config:

(use-package selectrum
  :custom (selectrum-max-window-height '15)
  :hook (after-init . selectrum-mode))

(use-package selectrum-prescient
  :hook ((selectrum-mode . selectrum-prescient-mode)
         (selectrum-prescient-mode . prescient-persist-mode)))

(use-package marginalia
  :hook (after-init . marginalia-mode))

(use-package consult
  :custom (consult-async-refresh-delay 0.1)
  :bind (("C-c h" . consult-history)
         ("C-c m" . consult-mode-command)
         ("C-c b" . consult-bookmark)
         ("C-c k" . consult-kmacro)
         ("C-x M-:" . consult-complex-command)
         ([remap switch-to-buffer] . consult-buffer)
         ([remap switch-to-buffer-other-window] . consult-buffer-other-window)
         ([remap switch-to-buffer-other-frame] . consult-buffer-other-frame)
         ([remap apropos] . consult-apropos)))

(use-package mini-frame
  :defer nil
  :custom ((mini-frame-show-parameters '((top    . 0.2)
                                         (width  . 0.8)
                                         (left   . 0.5)
                                         (left-fringe . 4)
                                         (right-fringe . 4)
                                         (height . 15)))
           (mini-frame-color-shift-step 6))
  :hook (after-init . mini-frame-mode))

I'm not sure which packages listed above actually make this issue. switch-to-buffer and switch-to-buffer-other-window with mini-frame doesn't have this problem. Consult with normal minibuffer also works well. So I guess maybe there are some conflicts between consult's preview feature and how mini-frame handle frames and windows. If necessary, I can open same issue at mini-frame as well.

Demo video:

issue.mp4
@minad
Copy link
Owner

minad commented Apr 24, 2021

Yes, there are miniframe issues. If you want to use miniframe, you can try to disable the Consult preview. I am hesitant to recommend miniframe in its current form. I suggest you ask on the miniframe bug tracker for potential fixes. I tried miniframe a few times but I've always observed issues. However this may not be the fault of miniframe itself. Unfortunately, the Emacs child-frame feature does not fully pass my quality expectations. When using posframe on my system it flickers, it is slow, does not draw the borders correctly, ...

See also #177, #178, #204, muffinmad/emacs-mini-frame#29, muffinmad/emacs-mini-frame#37

In case you open another issue on the miniframe issue tracker - the problem is with high probability that Consult makes assumptions about how the minibuffer behaves. Functions like minibuffer-active-window and minibuffer-selected-window should work, then the post-command-hook should be called in the correct context (the minibuffer context) and so on. If any of those assumptions is subtly violated, Consult previews may not work. Maybe some of the assumptions made in Consult can be relaxed, but generally I think it would be better to improve the "minibuffer emulation" of miniframe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants