minad / mini-popup

24 stars 3 forks source link

Issue with long texts #5

Closed Crandel closed 2 years ago

Crandel commented 2 years ago

Thank you for this amazing package. I have a small issue with this package. When I run list-packages and and try to update them pressing U -> x I get a confirmation request which is too long for one line, so it has truncated and I so only few last packages. Is it possible to exclude mini-popup for certain functions or maybe I have a wrong config?

(use-package mini-popup
  :load-path "mini-popup"
  :if window-system
  :defer 1
  :preface
  (defun mini-popup-height-resize ()
    (* (1+ (min vertico--total vertico-count)) (default-line-height)))
  (defun mini-popup-height-fixed ()
    (* (1+ (if vertico--input vertico-count 0)) (default-line-height)))
  :custom
  (mini-popup--height-function #'mini-popup-height-fixed)
  :config
  (advice-add #'vertico--resize-window :around
              (lambda (&rest args)
                (unless mini-popup-mode
                  (apply args))))
  (mini-popup-mode 1)
  :hook
  (consult--completion-refresh-hook . (lambda() (&rest _) (mini-popup--setup) 99))
) 
minad commented 2 years ago

Thanks! No excluding certain commands is not possible currently and I don't plan to add it. You can probably hack it via advices but I don't have a snippet at hand. mini-popup is only an experimental package where I tried to reuse my Corfu popup code and it is not published in a package repository. Personally I am not using child frames for anything else than Corfu. I think they are not good for minibuffer completion. See my criticism https://github.com/minad/vertico/#child-frames-and-popups. You may also want to give the alternatives a try. I assume that vertico-posframe can be enabled per completion command using vertico-multiform, but I haven't tried. See https://github.com/tumashu/vertico-posframe/issues/5. But vertico-posframe has other issues.

Crandel commented 2 years ago

I tried vertico-buffer-mode with vertico-multiform-mode - looks awesome. I have big monitor so I need minibuffer messages on top of the screen and this works even better for me. Thank you again for such useful packages

minad commented 2 years ago

Of course to each their own! But you are really losing crucial Emacs functionality with mini-popup/child frames. I try to not be too opinionated about "the best way" to use Emacs and I am also not too opinionated about how Emacs style UIs should look. For example Corfu is a popup UI, Vertico by default deviates from the usual Emacs buffer display and supports many alternative display styles, Consult works with all different kinds of UIs, etc. However child frames are really a dead end! I wonder why so many people go there. Mini-popup was my earnest attempt at this, so I also had to learn it the hard way. :smile:

Crandel commented 2 years ago

Yes, I tried all other popup alternatives an all of them are not working correctly with my setup. Posframe even refuse to start 😅