GithubHelp home page GithubHelp logo

muffinmad / emacs-mini-frame Goto Github PK

View Code? Open in Web Editor NEW
313.0 9.0 20.0 1.9 MB

Show minibuffer in child frame on read-from-minibuffer

License: GNU General Public License v3.0

Emacs Lisp 100.00%
emacs minibuffer childframe

emacs-mini-frame's Introduction

Stand With Ukraine

License GPL 3 MELPA

emacs-mini-frame

Place minibuffer at the top of the current frame on read-from-minibuffer.

While it's fine for me to have eldoc, flymake and other messages to appear at the bottom of the screen, editing minibuffer (find file, create VC branch, etc.) feels more comfortable in the upper area of the screen.

mini-frame-mode makes an advice around read-from-minibuffer function to create and show minibuffer-only child frame to accept input.

How it looks like

By default mini-frame is placed at the top of the current frame and occupies full width. Here is execute-extended-command (M-x) with icomplete-mode enabled:

Those who use vertical completion candidates list may configure mini-frame not to occupy full width:

(custom-set-variables
 '(mini-frame-show-parameters
   '((top . 10)
     (width . 0.7)
     (left . 0.5))))

Here is switch-to-buffer (C-x b) with ido-vertical-mode:

And execute-extended-command (M-x) with ivy-mode:

mini-frame-mode also creates a separate child frame to display completions list:

Mini-frame size

Users of Emacs 27 will benefits the most because of resize-mini-frames variable: mini-frame will be resized vertically to fit content.

Users of Emacs 26 will need to configure frame height explicitly, e.g.:

(custom-set-variables
 '(mini-frame-show-parameters
   '((top . 0)
     (width . 1.0)
     (left . 0.5)
     (height . 15))))

Gnome shell does not resize Emacs child frames

Until this issue will be solved, Gnome Shell users must also set mini-frame height.

Another option for Gnome Shell users is to use the following code in initialization file:

(setq x-gtk-resize-child-frames 'resize-mode)

Ignore commands

One can configure the list of commands that must not be shown in the child frame by customizing the mini-frame-ignore-commands. The eval-expression command is there by default because mini-frame have no modeline to display eldoc hints. And because there must be some place to turn mini-frame-mode off if something goes wrong (I hope not) :)

Installation and usage

mini-frame is available on MELPA.

Alternatively, you can download mini-frame.el and run:

M-x package-install-file RET <path-to-mini-frame-el> RET

M-x mini-frame-mode RET

emacs-mini-frame's People

Contributors

aaronjensen avatar conao3 avatar gcv avatar jixiuf avatar kiennq avatar krychu avatar muffinmad avatar stebalien avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs-mini-frame's Issues

Can I generalize the popped up frame?

I am very happy with my mini-frame popping up over the title bare of my emacs window.
A current limitation is that I am only able to get this behavior when reading from the mini-buffer.
I have various transient windows that I would like to handle in the same way (a new frame over the title bar).
Would it be possible to turn the mini-frame's frame creation into something that could generally be called by display-buffer?

Native compiling mini-frame in emacs 29 causes a compilation error

Hi, when installing mini-frame manually or via use-package I receive this error on startup:

Native compiler error: (lambda (arg0 &optional arg1 arg2 arg3 arg4 arg5 arg6) (let ((f #'read-from-minibuffer)) (funcall f arg0 arg1 arg2 arg3 arg4 arg5 arg6))), Compiling c:/Users/Jordan/.emacs.d/eln-cache/29.0.50-9632210b/subr--trampoline-726561642d66726f6d2d6d696e69627566666572_read_from_minibuffer_0.eln...
x86_64-w64-mingw32-gcc-12.2.0: fatal error: cannot execute 'as': CreateProcess: No such file or directory
compilation terminated.

With --debug-init we get:

Debugger entered--Lisp error: (native-compiler-error (lambda (arg0 &optional arg1 arg2 arg3 arg4 arg5 arg6) (let ((f #'read-from-minibuffer)) (funcall f arg0 arg1 arg2 arg3 arg4 arg5 arg6))) "Compiling c:/Users/Jordan/.emacs.d/eln-cache/29.0....")
  signal(native-compiler-error ((lambda (arg0 &optional arg1 arg2 arg3 arg4 arg5 arg6) (let ((f #'read-from-minibuffer)) (funcall f arg0 arg1 arg2 arg3 arg4 arg5 arg6))) "Compiling c:/Users/Jordan/.emacs.d/eln-cache/29.0...."))
  comp--native-compile((lambda (arg0 &optional arg1 arg2 arg3 arg4 arg5 arg6) (let ((f #'read-from-minibuffer)) (funcall f arg0 arg1 arg2 arg3 arg4 arg5 arg6))) nil "c:/Users/Jordan/.emacs.d/eln-cache/29.0.50-9632210...")
  comp-trampoline-compile(read-from-minibuffer)
  comp-subr-trampoline-install(read-from-minibuffer)
  advice--add-function(:around (#f(compiled-function () #<bytecode 0x3647c019df7e91>) . #f(compiled-function (gv--val) #<bytecode 0x85c60bbba7cb3c2>)) mini-frame-read-from-minibuffer nil)
  advice-add(read-from-minibuffer :around mini-frame-read-from-minibuffer)
  (if remove (advice-remove fn func) (advice-add fn :around func))
  (closure ((remove) (func . mini-frame-read-from-minibuffer)) (fn) (if remove (advice-remove fn func) (advice-add fn :around func)))(read-from-minibuffer)
  mapc((closure ((remove) (func . mini-frame-read-from-minibuffer)) (fn) (if remove (advice-remove fn func) (advice-add fn :around func))) (read-from-minibuffer read-string yes-or-no-p))
  mini-frame--advice((read-from-minibuffer read-string yes-or-no-p) mini-frame-read-from-minibuffer)
  (cond (mini-frame-mode (if (boundp 'minibuffer-follows-selected-frame) (progn (setq mini-frame--minibuffer-follows-selected-frame minibuffer-follows-selected-frame) (setq minibuffer-follows-selected-frame nil))) (mini-frame--advice mini-frame-advice-functions #'mini-frame-read-from-minibuffer) (mini-frame--advice mini-frame-ignore-functions #'mini-frame--ignore-function) (advice-add 'minibuffer-selected-window :around #'mini-frame--minibuffer-selected-window) (if mini-frame-create-lazy nil (add-hook 'window-setup-hook #'(lambda nil (let (...) (setq mini-frame-frame ...)))))) (t (if (boundp 'minibuffer-follows-selected-frame) (progn (setq minibuffer-follows-selected-frame mini-frame--minibuffer-follows-selected-frame))) (mini-frame--advice mini-frame-advice-functions #'mini-frame-read-from-minibuffer t) (mini-frame--advice mini-frame-ignore-functions #'mini-frame--ignore-function t) (advice-remove 'minibuffer-selected-window #'mini-frame--minibuffer-selected-window) (if (frame-live-p mini-frame-frame) (progn (delete-frame mini-frame-frame))) (if (frame-live-p mini-frame-completions-frame) (progn (delete-frame mini-frame-completions-frame)))))
  (let ((last-message (current-message))) (progn (set-default 'mini-frame-mode (cond ((eq arg 'toggle) (not (default-value 'mini-frame-mode))) ((and (numberp arg) (< arg 1)) nil) (t t)))) (if (boundp 'global-minor-modes) (progn (setq global-minor-modes (delq 'mini-frame-mode global-minor-modes)) (if (default-value 'mini-frame-mode) (progn (setq global-minor-modes (cons 'mini-frame-mode global-minor-modes)))))) (cond (mini-frame-mode (if (boundp 'minibuffer-follows-selected-frame) (progn (setq mini-frame--minibuffer-follows-selected-frame minibuffer-follows-selected-frame) (setq minibuffer-follows-selected-frame nil))) (mini-frame--advice mini-frame-advice-functions #'mini-frame-read-from-minibuffer) (mini-frame--advice mini-frame-ignore-functions #'mini-frame--ignore-function) (advice-add 'minibuffer-selected-window :around #'mini-frame--minibuffer-selected-window) (if mini-frame-create-lazy nil (add-hook 'window-setup-hook #'(lambda nil (let ... ...))))) (t (if (boundp 'minibuffer-follows-selected-frame) (progn (setq minibuffer-follows-selected-frame mini-frame--minibuffer-follows-selected-frame))) (mini-frame--advice mini-frame-advice-functions #'mini-frame-read-from-minibuffer t) (mini-frame--advice mini-frame-ignore-functions #'mini-frame--ignore-function t) (advice-remove 'minibuffer-selected-window #'mini-frame--minibuffer-selected-window) (if (frame-live-p mini-frame-frame) (progn (delete-frame mini-frame-frame))) (if (frame-live-p mini-frame-completions-frame) (progn (delete-frame mini-frame-completions-frame))))) (run-hooks 'mini-frame-mode-hook (if (default-value 'mini-frame-mode) 'mini-frame-mode-on-hook 'mini-frame-mode-off-hook)) (if (called-interactively-p 'any) (progn (customize-mark-as-set 'mini-frame-mode) (if (and (current-message) (not (equal last-message (current-message)))) nil (let ((local "")) (message "Mini-Frame mode %sabled%s" (if (default-value ...) "en" "dis") local))))))
  mini-frame-mode(t)
  load-with-code-conversion("c:/Users/Jordan/.emacs.d/completion.el" "c:/Users/Jordan/.emacs.d/completion.el" nil nil)
  load("~/.emacs.d/completion.el")

This is with no other customisations

[nativecomp] Mini frame not used unless called directly

I'm not too sure what's going on, but it seems that in my testing the most common user of read-from-minibuffer (completing-read and co.) are completely ignoring the advice on read-from-minibuffer.

$ emacs --version
GNU Emacs 28.0.50 (nativecomp branch)

Reproduction, from emacs -Q:

(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-refresh-contents)
(package-install 'mini-frame)
(mini-frame-mode +1)
  • in ielm: (read-from-minibuffer "test: ") uses the mini-frame as expected
  • in ielm: (completing-read "test: " '(a b)) uses the regular minibuffer
  • M-: (read-from-minibuffer "test: ") uses the regular minibuffer again
  • execute-extended-command uses the regular minibuffer

From my regular configuration, ivy-mode does end up making a mini-frame (behind the regular ivy window), but no other completing-read mode I've tried does (among icomplete, selectrum, fido, and none).

read-regexp vs read-string; isearch

First, thanks for your nice contribution!

I have two issues with mini-frame-mode enabled:

(1) E.g., do "M-x apropos". Everything is fine up to this point. However, as soon as I then do "Ret", I am in the usual minibuffer, i.e. that which appears without mini-frame-mode. But if, in apropos.el, I change the occurence of "read-string" into "read-regexp", I stay in the new frame, as expected.

(2) Doing "C-s" do invoke isearch, I come immediately in the usual minibuffer.

Konrad

How to properly setup mini-frame border color?

I'm having trouble setup the border color, below is my config:

(use-package mini-frame
  :custom ((mini-frame-internal-border-color "red")
           (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)
           (mini-frame-advice-functions '(completing-read)))
  :hook (after-init . mini-frame-mode))

What I get is below:
mini-frame

The border doesn't change. I've also tried adding (internal-border-color . "red") to the frame parameter list, but has no effect either.

Version: Emacs 28, native-comp branch
OS: Debian sid

Ivy actions not working by key

I'm using mini-frame-mode along with ivy and counsel. When I set ivy-read-action-function to 'ivy-read-action-by-key, I can press C-o when I have an item selected in ivy to see some alternate actions. I press i for one of the default actions, but instead of doing the action it just goes back to the original ivy prompt. So I'm unable to do any alternate actions with ivy while mini-frame-mode is enabled.

This is the error stack-trace:

Debugger entered--Lisp error: (error "Cannot resize the root window of a frame")
  error("Cannot resize the root window of a frame")
  window-resize(nil 0)
  ivy-shrink-after-dispatching()
  ivy-read-action-by-key((1 ("o" counsel-M-x-action "default") ("i" ivy--action-insert "insert") ("w" ivy--action-copy "copy") ("d" counsel--find-symbol "definition") ("h" #f(compiled-function (x) #<bytecode 0x1fc164baa8f343>) "help")))
  ivy-read-action()
  ivy-dispatching-done()
  funcall-interactively(ivy-dispatching-done)
  command-execute(ivy-dispatching-done)
  #<subr read-from-minibuffer>("M-x " nil (keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) keymap (67108903 . ivy-avy) (67108877 . ivy-immediate-done) (12 . ivy-alt-done) (67108896 . ivy-call-and-recenter) (insert-state keymap "Auxiliary keymap for Insert state" (11 . previous-line) (10 . next-line)) (33554443 . scroll-down-command) (33554442 . scroll-up-command) (11 . previous-line) (26 closure (t) (&rest _) (interactive) (condition-case nil (progn (call-interactively #'undo)) (error nil))) (23 . doom/delete-backward-word) (21 . evil-delete-back-to-indentation) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (19 . counsel-minibuffer-history) (36 . ivy-magic-read-file-env) (3 keymap (5 . +ivy/woccur) (19 . ivy-rotate-sort) (1 . ivy-toggle-ignore) (15 . ivy-occur)) (33554464 . ivy-restrict-to-matches) (15 . ivy-dispatching-done) (22 . yank) (prior . ivy-scroll-down-command) (next . ivy-scroll-up-command) (7 . minibuffer-keyboard-quit) (right . ivy-forward-char) (32 . self-insert-command) (18 . evil-paste-from-register) (remap keymap (doom/delete-backward-word . ivy-backward-kill-word) (describe-mode . ivy-help) (kill-ring-save . ivy-kill-ring-save) (kill-whole-line . ivy-kill-whole-line) (kill-line . ivy-kill-line) (scroll-down-command . ivy-scroll-down-command) (scroll-up-command . ivy-scroll-up-command) (end-of-buffer . ivy-end-of-buffer) (beginning-of-buffer . ivy-beginning-of-buffer) (kill-word . ivy-kill-word) (forward-char . ivy-forward-char) (delete-char . ivy-delete-char) (backward-kill-word . ivy-backward-kill-word) (backward-delete-char-untabify . ivy-backward-delete-char) (delete-backward-char . ivy-backward-delete-char) (previous-line . ivy-previous-line) (next-line . ivy-next-line)) (9 . ivy-partial-or-done) (10 . next-line) (27 keymap (1 . ivy-read-action) (15 . ivy-dispatching-call) (111 . hydra-ivy/body) (25 . ivy-insert-current-full) (105 . ivy-insert-current) (106 . ivy-yank-word) (114 . ivy-toggle-regexp-quote) (97 . ivy-toggle-marks) (16 . ivy-previous-line-and-call) (14 . ivy-next-line-and-call) (118 . ivy-scroll-down-command) (112 . ivy-previous-history-element) (110 . ivy-next-history-element) (10 . ivy-immediate-done) (13 . ivy-call)) (mouse-3 . ivy-mouse-dispatching-done) (mouse-1 . ivy-mouse-done) (down-mouse-1 . ignore) (13 . ivy-done)) nil counsel-M-x-history nil nil)
  mini-frame--display(#<subr read-from-minibuffer> ("M-x " nil (keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) keymap (67108903 . ivy-avy) (67108877 . ivy-immediate-done) (12 . ivy-alt-done) (67108896 . ivy-call-and-recenter) (insert-state keymap "Auxiliary keymap for Insert state" (11 . previous-line) (10 . next-line)) (33554443 . scroll-down-command) (33554442 . scroll-up-command) (11 . previous-line) (26 closure (t) (&rest _) (interactive) (condition-case nil (progn (call-interactively #'undo)) (error nil))) (23 . doom/delete-backward-word) (21 . evil-delete-back-to-indentation) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (19 . counsel-minibuffer-history) (36 . ivy-magic-read-file-env) (3 keymap (5 . +ivy/woccur) (19 . ivy-rotate-sort) (1 . ivy-toggle-ignore) (15 . ivy-occur)) (33554464 . ivy-restrict-to-matches) (15 . ivy-dispatching-done) (22 . yank) (prior . ivy-scroll-down-command) (next . ivy-scroll-up-command) (7 . minibuffer-keyboard-quit) (right . ivy-forward-char) (32 . self-insert-command) (18 . evil-paste-from-register) (remap keymap (doom/delete-backward-word . ivy-backward-kill-word) (describe-mode . ivy-help) (kill-ring-save . ivy-kill-ring-save) (kill-whole-line . ivy-kill-whole-line) (kill-line . ivy-kill-line) (scroll-down-command . ivy-scroll-down-command) (scroll-up-command . ivy-scroll-up-command) (end-of-buffer . ivy-end-of-buffer) (beginning-of-buffer . ivy-beginning-of-buffer) (kill-word . ivy-kill-word) (forward-char . ivy-forward-char) (delete-char . ivy-delete-char) (backward-kill-word . ivy-backward-kill-word) (backward-delete-char-untabify . ivy-backward-delete-char) (delete-backward-char . ivy-backward-delete-char) (previous-line . ivy-previous-line) (next-line . ivy-next-line)) (9 . ivy-partial-or-done) (10 . next-line) (27 keymap (1 . ivy-read-action) (15 . ivy-dispatching-call) (111 . hydra-ivy/body) (25 . ivy-insert-current-full) (105 . ivy-insert-current) (106 . ivy-yank-word) (114 . ivy-toggle-regexp-quote) (97 . ivy-toggle-marks) (16 . ivy-previous-line-and-call) (14 . ivy-next-line-and-call) (118 . ivy-scroll-down-command) (112 . ivy-previous-history-element) (110 . ivy-next-history-element) (10 . ivy-immediate-done) (13 . ivy-call)) (mouse-3 . ivy-mouse-dispatching-done) (mouse-1 . ivy-mouse-done) (down-mouse-1 . ignore) (13 . ivy-done)) nil counsel-M-x-history))
  mini-frame-read-from-minibuffer(#<subr read-from-minibuffer> "M-x " nil (keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) keymap (67108903 . ivy-avy) (67108877 . ivy-immediate-done) (12 . ivy-alt-done) (67108896 . ivy-call-and-recenter) (insert-state keymap "Auxiliary keymap for Insert state" (11 . previous-line) (10 . next-line)) (33554443 . scroll-down-command) (33554442 . scroll-up-command) (11 . previous-line) (26 closure (t) (&rest _) (interactive) (condition-case nil (progn (call-interactively #'undo)) (error nil))) (23 . doom/delete-backward-word) (21 . evil-delete-back-to-indentation) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (19 . counsel-minibuffer-history) (36 . ivy-magic-read-file-env) (3 keymap (5 . +ivy/woccur) (19 . ivy-rotate-sort) (1 . ivy-toggle-ignore) (15 . ivy-occur)) (33554464 . ivy-restrict-to-matches) (15 . ivy-dispatching-done) (22 . yank) (prior . ivy-scroll-down-command) (next . ivy-scroll-up-command) (7 . minibuffer-keyboard-quit) (right . ivy-forward-char) (32 . self-insert-command) (18 . evil-paste-from-register) (remap keymap (doom/delete-backward-word . ivy-backward-kill-word) (describe-mode . ivy-help) (kill-ring-save . ivy-kill-ring-save) (kill-whole-line . ivy-kill-whole-line) (kill-line . ivy-kill-line) (scroll-down-command . ivy-scroll-down-command) (scroll-up-command . ivy-scroll-up-command) (end-of-buffer . ivy-end-of-buffer) (beginning-of-buffer . ivy-beginning-of-buffer) (kill-word . ivy-kill-word) (forward-char . ivy-forward-char) (delete-char . ivy-delete-char) (backward-kill-word . ivy-backward-kill-word) (backward-delete-char-untabify . ivy-backward-delete-char) (delete-backward-char . ivy-backward-delete-char) (previous-line . ivy-previous-line) (next-line . ivy-next-line)) (9 . ivy-partial-or-done) (10 . next-line) (27 keymap (1 . ivy-read-action) (15 . ivy-dispatching-call) (111 . hydra-ivy/body) (25 . ivy-insert-current-full) (105 . ivy-insert-current) (106 . ivy-yank-word) (114 . ivy-toggle-regexp-quote) (97 . ivy-toggle-marks) (16 . ivy-previous-line-and-call) (14 . ivy-next-line-and-call) (118 . ivy-scroll-down-command) (112 . ivy-previous-history-element) (110 . ivy-next-history-element) (10 . ivy-immediate-done) (13 . ivy-call)) (mouse-3 . ivy-mouse-dispatching-done) (mouse-1 . ivy-mouse-done) (down-mouse-1 . ignore) (13 . ivy-done)) nil counsel-M-x-history)
  apply(mini-frame-read-from-minibuffer #<subr read-from-minibuffer> ("M-x " nil (keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) keymap (67108903 . ivy-avy) (67108877 . ivy-immediate-done) (12 . ivy-alt-done) (67108896 . ivy-call-and-recenter) (insert-state keymap "Auxiliary keymap for Insert state" (11 . previous-line) (10 . next-line)) (33554443 . scroll-down-command) (33554442 . scroll-up-command) (11 . previous-line) (26 closure (t) (&rest _) (interactive) (condition-case nil (progn (call-interactively #'undo)) (error nil))) (23 . doom/delete-backward-word) (21 . evil-delete-back-to-indentation) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (19 . counsel-minibuffer-history) (36 . ivy-magic-read-file-env) (3 keymap (5 . +ivy/woccur) (19 . ivy-rotate-sort) (1 . ivy-toggle-ignore) (15 . ivy-occur)) (33554464 . ivy-restrict-to-matches) (15 . ivy-dispatching-done) (22 . yank) (prior . ivy-scroll-down-command) (next . ivy-scroll-up-command) (7 . minibuffer-keyboard-quit) (right . ivy-forward-char) (32 . self-insert-command) (18 . evil-paste-from-register) (remap keymap (doom/delete-backward-word . ivy-backward-kill-word) (describe-mode . ivy-help) (kill-ring-save . ivy-kill-ring-save) (kill-whole-line . ivy-kill-whole-line) (kill-line . ivy-kill-line) (scroll-down-command . ivy-scroll-down-command) (scroll-up-command . ivy-scroll-up-command) (end-of-buffer . ivy-end-of-buffer) (beginning-of-buffer . ivy-beginning-of-buffer) (kill-word . ivy-kill-word) (forward-char . ivy-forward-char) (delete-char . ivy-delete-char) (backward-kill-word . ivy-backward-kill-word) (backward-delete-char-untabify . ivy-backward-delete-char) (delete-backward-char . ivy-backward-delete-char) (previous-line . ivy-previous-line) (next-line . ivy-next-line)) (9 . ivy-partial-or-done) (10 . next-line) (27 keymap (1 . ivy-read-action) (15 . ivy-dispatching-call) (111 . hydra-ivy/body) (25 . ivy-insert-current-full) (105 . ivy-insert-current) (106 . ivy-yank-word) (114 . ivy-toggle-regexp-quote) (97 . ivy-toggle-marks) (16 . ivy-previous-line-and-call) (14 . ivy-next-line-and-call) (118 . ivy-scroll-down-command) (112 . ivy-previous-history-element) (110 . ivy-next-history-element) (10 . ivy-immediate-done) (13 . ivy-call)) (mouse-3 . ivy-mouse-dispatching-done) (mouse-1 . ivy-mouse-done) (down-mouse-1 . ignore) (13 . ivy-done)) nil counsel-M-x-history))
  read-from-minibuffer("M-x " nil (keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) keymap (67108903 . ivy-avy) (67108877 . ivy-immediate-done) (12 . ivy-alt-done) (67108896 . ivy-call-and-recenter) (insert-state keymap "Auxiliary keymap for Insert state" (11 . previous-line) (10 . next-line)) (33554443 . scroll-down-command) (33554442 . scroll-up-command) (11 . previous-line) (26 closure (t) (&rest _) (interactive) (condition-case nil (progn (call-interactively #'undo)) (error nil))) (23 . doom/delete-backward-word) (21 . evil-delete-back-to-indentation) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (19 . counsel-minibuffer-history) (36 . ivy-magic-read-file-env) (3 keymap (5 . +ivy/woccur) (19 . ivy-rotate-sort) (1 . ivy-toggle-ignore) (15 . ivy-occur)) (33554464 . ivy-restrict-to-matches) (15 . ivy-dispatching-done) (22 . yank) (prior . ivy-scroll-down-command) (next . ivy-scroll-up-command) (7 . minibuffer-keyboard-quit) (right . ivy-forward-char) (32 . self-insert-command) (18 . evil-paste-from-register) (remap keymap (doom/delete-backward-word . ivy-backward-kill-word) (describe-mode . ivy-help) (kill-ring-save . ivy-kill-ring-save) (kill-whole-line . ivy-kill-whole-line) (kill-line . ivy-kill-line) (scroll-down-command . ivy-scroll-down-command) (scroll-up-command . ivy-scroll-up-command) (end-of-buffer . ivy-end-of-buffer) (beginning-of-buffer . ivy-beginning-of-buffer) (kill-word . ivy-kill-word) (forward-char . ivy-forward-char) (delete-char . ivy-delete-char) (backward-kill-word . ivy-backward-kill-word) (backward-delete-char-untabify . ivy-backward-delete-char) (delete-backward-char . ivy-backward-delete-char) (previous-line . ivy-previous-line) (next-line . ivy-next-line)) (9 . ivy-partial-or-done) (10 . next-line) (27 keymap (1 . ivy-read-action) (15 . ivy-dispatching-call) (111 . hydra-ivy/body) (25 . ivy-insert-current-full) (105 . ivy-insert-current) (106 . ivy-yank-word) (114 . ivy-toggle-regexp-quote) (97 . ivy-toggle-marks) (16 . ivy-previous-line-and-call) (14 . ivy-next-line-and-call) (118 . ivy-scroll-down-command) (112 . ivy-previous-history-element) (110 . ivy-next-history-element) (10 . ivy-immediate-done) (13 . ivy-call)) (mouse-3 . ivy-mouse-dispatching-done) (mouse-1 . ivy-mouse-done) (down-mouse-1 . ignore) (13 . ivy-done)) nil counsel-M-x-history)

(setq ivy-read-action-function 'ivy-read-action-ivy)

Does work, but isn't the type of action completion that I ultimately want.

Set Alpha.

First, Awesome pacakge. โค๏ธ

I tried set alpha value of the minibuffer frame by below code.

(setq mini-frame-show-parameters '((alpha . (80 70)) (top . 20) (width . 0.6) (left . 0.5)))

and I see the value (80 70) by evaluate (frame-parameter mini-frame-frame 'alpha)
but it has no effect.

Compare with ivy-posframe

Hi, I tried this great package, but I am still wondering what's the difference between mini-frame and ivy-posframe. What's the advantage of mini-frame?

Thanks!

Cannot set mini-frame to transparent

Emacs version: GNU Emacs 28.1
OS: 5.16.18-1-MANJARO
Desktop: KDE Plasma 5.24.6

Thanks for writing this package. I have been perpetually annoyed by my modeline jumping around when mini buffer resizes. It's not an issue anymore thanks to mini-frame.

However, I cannot set the transparency of the mini-frame when it is child frame through the alpha frame parameter. But as a standalone frame, it does show up as transparent. My compositor is KDE's kwin, and transparency definitely works in general.

Value of mini-frame-show-parameters

'((left . 0.5)
  (top . 0.0)
  (width . 1.0)
  (height . 1)
  (alpha . 50))

No standalone (child frame):
Screenshot_20220803_152645

Standalone (transparency working):
Screenshot_20220803_153217

mini-frame-resize = t causes mini-frame to flicker

It looks like the resizing happens after the frame is displayed, so it becomes visible as an annoying flickering:

mini-frame-flicker

I am on the latest version of mini-frame, my config looks like this:

(setf
 mini-frame-resize t
 mini-frame-ignore-commands
 '(eval-expression
   "edebug-eval-expression"
   debugger-eval-expression
   ".*helm.*")
 mini-frame-show-parameters
 '((background-color . "#2E2E32")
   (left . 0.5)
   (top . 40)
   (width . 0.6)
   (height . 0.5)))

In case it's relevant: I am also using selectrum and marginalia.

mini-frame move to the center of the screen

The mini-frame first appear at the top of the frame, the it blink and move to the center of the screen. I use Emacs 28.0.60 and I try mini-frame the first time so I don't know whether this issue happen with older version of Emacs

Screen Shot 2021-10-17 at 22 35 19

GNU Emacs 28.0.60 (build 1, x86_64-apple-darwin20.6.0, NS appkit-2022.60 Version 11.6 (Build 20G165)) of 2021-10-17

;;; emacs -nw -Q -l ~/.config/emacs/test.el

(setq package-archives '(("melpa"        . "https://melpa.org/packages/")
                         ("melpa-stable" . "https://stable.melpa.org/packages/")
                         ("org"          . "https://orgmode.org/elpa/")
                         ("gnu"          . "https://elpa.gnu.org/packages/"))
      package-user-dir (concat user-emacs-directory "elpa/"
                               (format "%d%s%d"
                                       emacs-major-version
                                       version-separator
                                       emacs-minor-version)))

;; initialize packages
(unless (bound-and-true-p package--initialized) ; To avoid warnings in 27
  (setq package-enable-at-startup nil)          ; To prevent initializing twice
  (package-initialize))

;; setup `use-package'
(unless (package-installed-p 'use-package)
  (when (not package-archive-contents)
    (package-refresh-contents))
  (package-install 'use-package))

(require 'use-package)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package vertico
  :init
  (vertico-mode))

(use-package mini-frame
  :init
  (mini-frame-mode))

empty minibuffer is shown fullscreen with activated default-frame-alist

OS: Windows 10
I configured my .emacs to open emacs maximised (add-to-list 'default-frame-alist '(fullscreen . maximized)).
Everything works fine unless I switch to another program and come back to emacs. An empty minibuffer will be shown fullscreen and I'm not able to close it or emacs.

Using initial-frame-alist is a workaround. Until now I don't have to use default-frame-alist

keys are not being captured while Emacs is busy

I have the following use case:

I'm using global-tags for navigating a project. So sometimes I do (project-files) (project-find-file) to quickly jump to a certain file in the source code.

So what global-tags does underneath is run a shell command command, get the output, split into a list of lines and last select one of the lines. I'm using tramp (and also not doing an Ivy async process) so it takes a second or two to ivy to display.

During that time, Emacs is blocking, but still accepting input. So what I normally due is to start typing before ivy displays (because I kinda know beforehand where I'm going to).

And here's the difference: mini-frame will queue the input but (incorrectly) forward that input to the last buffer that was focused and not to the mini-frame.

Can the input be forcefully captured and redirected to the mini-frame while Emacs is blocking?

PS= great package you did here... can't thank you enough

Display mini-frame at top of emacs' title bar?

(I run emacs 28.0.50 built with --with-x-toolkit=gtk2.)

I would like to position the mini-frame over the OS
window manager's title bar. (OS is Ubuntu 20.10.)

With mini-frame-standalone nil everything works very
nicely except that mini-frame obliterates the first line
of any Emacs window touching the top of the managed
area.

Is this possible with the current package? If so, how?
If not, could it be added?

How change font size

Hello author, I want to ask if I can change font size, and how to change font size. Thanks

Redirect frame focus

Sometimes, especially when running an interactive command with slow completion results (flyspell, consult-lines, etc.):

  1. I'll run the command.
  2. I'll start typing before the mini-frame shows up.
  3. When the frame shows up, my input focus will not properly switch to the new frame.

I've found this can bey fixed by calling (redirect-frame-focus selected-frame mini-frame-frame) right before (make-frame-visible mini-frame-frame) in mini-frame--display. This also doesn't appear to have any unwanted side effects.

I'm submitting this as a bug report, not a patch, as:

  1. I'm not sure why this is happening.
  2. Given this fix, I'd assume that the mini-frame would keep focus (making it impossible to interact with the rest of emacs while the mini-frame is in use). However, this is not the case.

Placing the frame above X windows (with EXWM)

Hey! Super nice work on this package.

I've been using it for a bit now, but there's one problem I haven't managed to figure out yet: I use EXWM, and the mini-frame is always displayed behind X windows, which is unfortunate. From what I understand, this is because of how EXWM displays X windows and stacks them. Do you know of or is there a documented workaround to make the mini-frame float on top of X windows under EXWM?

I know it's possible to get around somehow, and there is a workaround for ivy-posframe. As such, I reckon there might also be a workaround for this package, but I don't know exactly what it'd be. I appreciate that this issue might belong on EXWM's tracker, but I think it would be prudent to understand how it works on both ends, so I thought I'd check in here first. Sorry if that's a bother.

@Stebalien: apologies for the impromptu tag, but I've seen you participating in both the ivy-posframe discussion and on this package, so I was thinking you might have some insight. Do you have any tips? Have you made it work with EXWM?

Appreciate any insight, tips, and tricks.
Cheers!

mini-frame flickers when resizing

There is a bug in Emacs on macOS that causes frames to flicker when they are resized: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46155

There's a patch for it that works for me.

However, when mini-frames are resized, there is still a flicker, which makes me wonder if there's more going on when a min-frame is resized. I've been trying to narrow down a repro, but so far when I actually manually resize a mini-frame, it does not flicker.

Any idea what may cause the flicker? Is it perhaps being hidden and shown any time it resizes?

Selectively enabling mini-frame

I'm trying to selectively enable mini-frame for some commands, and it doesn't quite work as I'd like.

Specifically, I want to enable mini-frame with Selectrum for specific commands, rather than wholesale. Pretty sure my approach will generalize to, e.g., icomplete-vertical.

Consider the following code:

(defun /with-selectrum (fn)
  (let ((status-selectrum selectrum-mode))
    (unwind-protect
        (progn
          (selectrum-mode 1)
          (if window-system
              (mini-frame-read-from-minibuffer (lambda () (call-interactively fn)))
            (call-interactively fn)))
      (unless status-selectrum (selectrum-mode -1)))))

(defun /selectrum-M-x ()
  (interactive)
  (/with-selectrum #'execute-extended-command))

(defun /selectrum-find-file ()
  (interactive)
  (/with-selectrum #'find-file))

(global-set-key (kbd "M-x") #'/selectrum-M-x)
(global-set-key (kbd "C-x C-f") #'/selectrum-find-file)

M-x works fine, but C-x C-f runs into a couple of kinds of trouble.

  1. The newly-visited file opens in a split window instead of the current window. At first, I thought I used call-interactively incorrectly, but the split doesn't happen if I change /with-selectrum to not use mini-frame.

  2. When attempting to visit a file which is a symlink to a source-controlled file someplace else, i.e., behavior governed by vc-follow-symlinks, the prompt appears in the mini-frame instead of the minibuffer. When mini-frame-mode and selectrum-mode are enabled normally, this does not occur. Which led me to try just temporarily enabling mini-frame-mode along with selectrum-mode, but this had other problems (notably visibly worse performance, as the mini frame has to be recreated on each command).

I'll be grateful for any guidance you might have on this.

Missing content and focus lost

Hey again ๐Ÿ‘‹๐Ÿผ

Thanks a lot for the package! 90% of the time it is absolutely great! But I do have a two issues that pop up semiregularly. I'll add them both in this issue for now (but I would be happy to split them out if you prefer).

Update: I realized I was not on the latest version of this package (about a year behind). That's been rectified now. I couldn't reproduce the focus issue, at least. I don't know about the missing text, because that appears to happen just whenever. I'll leave the issue open for now in case the first issue is new or the second one reappears, but it is possible that both of these are fixed.

1: Missing text

Description

Sometimes, the frame doesn't seem to render all the text correctly. In the following screenshot, I've started typing confi, but what shows up seems to be missing most characters:

image

Expected outcome

I'd expect it to render correctly. For reference, this is what I get when it renders as I expect.

image

Steps to reproduce

Sadly, I don't know how to reproduce this. It seems to happen at random.

2: Focus lost (Edit: may not be an issue)

Description

Sometimes, when performing interactive commands, such as consult-ripgrep, the focus shifts to the main buffer as I'm typing the search string, causing the mini frame to lose focus and the background buffer to gain focus and receive unwanted input.

This also causes the mini frame to remain open while focus is in the other buffer, and I haven't found a reliable way to move focus back to the mini frame without using the mouse. To close it, doing M-x to try and force open a different menu seems to work.

This seems similar to #37, but is not solved.

Image of when it happens:

image

Expected outcome

I'd expect the focus to remain in the minibuffer until I select one of the options.

Steps to reproduce

This isn't 100%, but this seems to be the case:

  1. Trigger consult-ripgrep (it might work with other commands, but I don't know)
  2. As soon as you can start typing a string you're searching for. The longer it is (or the larger the repo is?), the more likely it is to trigger, it seems.
  3. Watch the point move to the buffer and the mini frame be left alone.

Thoughts

This may related to consult, which shows you a preview of the whole buffer as candidates are selected. That means that the buffer you're seeing behind the mini-frame can change rapidly while you're typing. I've consulted their issues and I know there are issues with how mini-frame and consult work together. However, I thought I'd mention it anyway, in case it helps us find a solution in some way.

mini-frame configuration

For reference, here's the configuration block I'm using:

(use-package mini-frame
  :unless (string= "t" (getenv "SUPPRESS_MINI_FRAME"))
  :custom
  (mini-frame-show-parameters '((top . 15)
                                (width . 0.5)
                                (left . 0.5)
                                (alpha . 80)))
  (mini-frame-resize 'resize)
  (mini-frame-color-shift-step 0)

  (custom-set-faces
   ;; set a border for the child frame mini frame uses. Set it to the
   ;; default text color.
   `(child-frame-border ((t (:background ,(face-attribute 'default :foreground))))))

  :config
  (setq mini-frame-standalone nil)
  :init
  (mini-frame-mode))

Thanks for listening and thanks again for the package! Any input is much appreciated ๐Ÿ˜„

Set Position

Great job is great,

Only one query can put an option to choose the position of the minibuffer, in my case I would like it to be at the bottom.

Greetings.

`C-g` doesn't quit minibuffer

Emacs version:

GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.31, cairo version 1.17.4) of 2022-04-29

Steps to Reproduce:
emacs -Q

(package-initialize)
(require 'mini-frame)
(mini-frame-mode)

M-x
C-g
--> At this point the minibuffer should close, no longer accepting input and the focus returned to the *scratch* buffer.
Instead it remains there with a [Quit] text added. Any input at this point will go into the minibuffer, Another C-g is required to actually quit.

Canceling the mini-buffer causes annoying glash

After solving #39 mini-frame is working quite nicely now.
One annoyance remains. If, rather than complete some
action, I cancel (C-g) out of the mini-buffer, I see white
flash, corresponding to the mini-buffer line.
Peek 2021-04-04 13-14

Is there anyway to eliminate that flash?

How to add custom colors?

image

Hey Dev!!
As you can see above, due to theme, default options are not highlighted.
I tried to dig a bit but due to lack of knowledge, I couldn't able to find any solution for that.
I only able to found that Mini Frame get colors from mini-frame-get-background-color function.

Is there any workaround or option to change background, foreground and highlighted option color?

Unable to ignore y-or-n-p, yes-or-no-p

I have:

  (setq mini-frame-ignore-commands '(eval-expression
                                     "edebug-eval-expression"
                                     debugger-eval-expression
                                     y-or-n-p
                                     yes-or-no-p
                                     "ctrlf-.*"
                                     ))

But evaluating (y-or-n-p "test") still pops up the mini-frame. What am I doing wrong?

Strange behavior with keybindings

I use the following piece of code to avoid killing Emacs accidentally:

(global-set-key
 (kbd "C-x C-c")
 (lambda ()
   (interactive)
   (if (not (y-or-n-p "Are you sure you want to exit Emacs? "))
       (message "Canceled exit")
     (save-buffers-kill-emacs))))

It normally works, but with mini-frame-mode turned on, it errors out: Wrong type argument: symbolp, ....

Display matches on no input for vertico

Below is what I used to reproduce the bug:

  1. (setq mini-frame-standalone t) ;; this is a buggy option and I enable it intentionally
  2. Call something with many candidates, for example: describe-function or describe-variable, then you may see something like this:
    Screenshot_2021-05-24_22-45-27

This is not 100% reproducible, you might have to try several times.

  1. After 2 is success, now invoke find-file, then you'll get no candidate displayed when no input.
    Screenshot_2021-05-24_22-48-47

I use edebug to trace mini-frame--display and find problem occurs at this line. Actually, child frame displays normally at first but shrinks to height 1 immediately, so this may be a bug related to mini-frame-resize.

Reference: minad/vertico#34

Conflict with consult-imenu

When I have mini-frame-mode enabled and call consult-imenu, this error occurs:
redisplay--pre-redisplay-functions: (error "Cannot resize the root window of a frame")

Also, one thing to mention is that consult-imenu also creates it's own buffer, but the menu is available in both the mini-frame and the buffer that consult-imenu creates.

Would there be any way to disable mini-frame-mode before consult-imenu creates its own buffer?

This issue is not reproducible with standard imenu.

Does not show full minibuffer with some Selectrum functions

Selectrum is a good candidate to pair with mini-frame-mode, but I found the following incompatibility: with mini-frame-mode turned on, some commands (like switch-to-buffer) do not show the expected candidate list. Other commands (find-file) have no problem.

To reproduce, get a sandbox Emacs environment and install Selectrum. Then install mini-frame-mode. Enable just Selectrum ((selectrum-mode 1)). Play around with it, note how find-file and switch-to-buffer show candidate lists right away. Now turn on mini-frame-mode ((mini-frame-mode 1)). Note that find-file shows a candidate list, just as expected, but switch-to-buffer only shows one when you start typing.

Not sure what's going on here, but it looks like, under some conditions, mini-frame-mode does not show the full minibuffer.

[PATCH] Make border-color work for both child and standalone frames

From 49942487593ed9aa7cf7a1f206bd2aa31db32963 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <[email protected]>
Date: Sat, 26 Jun 2021 12:58:12 +0300
Subject: [PATCH] Make border-color work for both child and standalone frames

---
Be aware, it is a breaking change, but I think it's reasonable to
rename the variable.  Also, it seems ok to set both faces
unconditionally because it affects only mini-frame's frame.

 mini-frame.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mini-frame.el b/mini-frame.el
index f608b8e..67dc119 100644
--- a/mini-frame.el
+++ b/mini-frame.el
@@ -102,7 +102,7 @@ to determine background color of mini frame."
 Called if `mini-frame-show-parameters' doesn't specify background color."
   :type 'function)
 
-(defcustom mini-frame-internal-border-color nil
+(defcustom mini-frame-border-color nil
   "When set, set the internal border color of mini-frames to this color."
   :type '(choice (const :tag "Not set" nil)
                  (color :tag "Color")
@@ -273,8 +273,9 @@ This function used as value for `resize-mini-frames' variable."
                                      (drag-internal-border . t)
                                      (z-group . above))))))
     (set-face-background 'fringe nil frame)
-    (when mini-frame-internal-border-color
-      (set-face-background 'internal-border mini-frame-internal-border-color frame))
+    (when mini-frame-border-color
+      (set-face-background 'child-frame-border mini-frame-border-color frame)
+      (set-face-background 'internal-border mini-frame-border-color frame))
     frame))
 
 (defun mini-frame--move-frame-to-frame (frame to-frame)
-- 
2.32.0

Emacs slowdowns sometimes cause hidden mini frame to appear

This is tricky to reproduce, and may be related to something in the emacs-mac port. When a mini-frame exists but is not visible, then sometimes, when the main Emacs thread slows down, the mini-frame appears, but not in the location where it's supposed to be. For example, when magit-status takes a while, the mini-frame might pop up. I've also seen it happen when outline-minor-mode churns through a particularly slow outline-regexp. I can't make it happen with something straightforward like (sleep-for 5), unfortunately.

Given the strangeness of this bug, I'm just opening this ticket in case this is a known problem or someone sees something like it.

EDIT: After this happens, Cmd-` (which does OS-level frame switching on the Mac) starts to pick up the mini-frame and allows switching to it. Normally this does not happen. After any command forces the mini frame to render normally, its correct behavior resumes.

Is it possible to make `yes-or-no` pop up?

I figured it out how to make it work for eval-expression (by removing it from ignored commands), but not succeed with yes-or-no yet. Want it to be in a child frame too.

A really cool package, thank you very much for creating it)

`C-g` doesn't return focus visually

Focus is returned in that input is being sent to the correct window, but the visual indicators show all windows as inactive.

I haven't had time to dig into this yet, otherwise I might be able to submit a PR for this in due time.

Visual line mode

hi,

long lines (like pathnames) need to be scrolled to the end on my half width minibuffer, to get the full idea, i'd like to enable visual-line-mode for just the mini-buffer.

any way i can do that? thanks.

debian emacs 27 - mini frame doesnt show initial candidates

miniframe doesnt show anything until I type something. Using selectrum if that makes any difference, eg here I open magit and type b l to check out a local branch. Nothing is listed until I type a letter then it works.

Bildschirmfoto vom 2021-01-06 23-35-28

Standard use-package

      (use-package mini-frame
        :config
        (setq x-gtk-resize-child-frames 'resize-mode)
        (mini-frame-mode))

Selectrum

       (use-package selectrum
         :config
         (use-package selectrum-prescient
           :config
           (selectrum-mode +1)
           (use-package sudo-edit)
           ;;(global-set-key (kbd "M-r") #'selectrum-repeat)
           :bind
           ("<f4>" . 'find-file)))

full init.el

Mini-frame prints (by error) my custom garbage collection message?

Here is my mini-frame setup on Emacs 27.1 and Ubuntu 20.04.1:

(use-package mini-frame
  ;; https://github.com/muffinmad/emacs-mini-frame
  ;; Show minibuffer in child frame on read-from-minibuffer
  :init (setq mini-frame-show-parameters '((top . 10)
					   (width . 0.7)
					   (left . 0.5))
	      mini-frame-create-lazy nil
	      mini-frame-color-shift-step 0)

  ;; workaround bug#44080, should be fixed in version 27.2 and above, see #169
  (define-advice fit-frame-to-buffer
      (:around (f &rest args) dont-skip-ws-for-mini-frame)
    (cl-letf* ((orig (symbol-function #'window-text-pixel-size))
               ((symbol-function #'window-text-pixel-size)
		(lambda (win from to &rest args)
                  (apply orig
			 (append (list win from
                                       (if (and (window-minibuffer-p win)
						(frame-root-window-p win)
						(eq t to))
                                           nil
					 to))
				 args)))))
      (apply f args)))
  :config
  (mini-frame-mode +1))

I am also using selectrum:

(use-package selectrum-prescient
  ;; https://github.com/raxod502/prescient.el
  ;; Simple but effective sorting and filtering for Emacs.
  ;; For Selectrum.
  :config
  (selectrum-prescient-mode +1)
  ;; Save your command history on disk, so the sorting gets more
  ;; intelligent over time
  (prescient-persist-mode +1)
  )

(use-package selectrum
  ;; https://github.com/raxod502/selectrum
  ;; Incremental narrowing in Emacs
  :after mini-frame
  :init (setq selectrum-num-candidates-displayed
	      (- danylo/num-completion-candidates 1)
	      ;; Enable completion for projectile
	      projectile-completion-system 'default)
  :config
  (selectrum-mode +1)

  ;; Make sorting and filtering more intelligent
  (selectrum-prescient-mode +1)

  ;; Save your command history on disk, so the sorting gets more
  ;; intelligent over time
  (prescient-persist-mode +1)

  ;; After configuring `mini-frame-show-parameters` adjust the height
  ;; according to number of candidates
  (setf (alist-get 'height mini-frame-show-parameters)
	(1+ selectrum-num-candidates-displayed))
  )

My problem: I have the following customization of the garbage collection message:

;;;###autoload
(defun danylo/gc-message ()
  "Garbage collection message."
  (when garbage-collection-messages
    (let ((message-log-max nil))
      (message "%s Collecting garbage"
	       (propertize (all-the-icons-faicon "trash-o")
			   'face `(:family
				   ,(all-the-icons-faicon-family)
				   :height 1.0)
			   'display '(raise -0.05))))))

(add-hook 'post-gc-hook (lambda () (danylo/gc-message) nil))

(setq garbage-collection-messages t)

After garbage collection runs and my custom message is printed, I'm seeing an artifact in the mini-frame that the garbage collection message is printed after the prompt (for no reason). This is not happening when using selectrum in the minibuffer, so I'm assuming that it must be a mini-frame thing.

image

Mini frame min width?

Is there a way to specify a minimum width for the mini frame? For instance, when Emacs occupies my full screen, I don't want the mini-frame to take up more than 50% of the width, but when the emacs frame is narrowed, I'd like the mini frame to take up at least n pixels.

I feel like I've seen a way to do this before, but I couldn't find anything while looking now.

Thanks! ๐Ÿ™๐Ÿผ

Issues when quitting completion

I am using wslg with emacs-pgtk, when I try to close the miniframe, it is moved down, and is still visible, and it appears as a window in itself, you can cycle ALT-TAB to it from windows; the window is only present after I quit the completion (if I try to ALT-TAB while reading a completion, the minibuffer frame/window is not present, can't be ALT-TABbed).
miniframe

Conflict with vertico-multiform

I use vertico-multiform to change the style that completion candidates are shown in, for example vertico-multiform-flat changes the completions to a "flat" list that shows 1 candidate as you type, you can also automatically change the completion candidate style for different commands.

So I changed what M-x (execute-extended-command) looks like with that "flat" style, but I get an error with mini-frame, which blocks execute-extended-command from running, therefore I can't M-x:
Error in minibuffer-exit-hook (vertico-multiform--exit): (error "Cannot resize the root window of a frame")

So there is some conflict going on between vertico-multiform-flat and mini-frame, this error doesn't occur with find-file and consult-buffer since I don't use vertico-multiform on them to change what completion candidates look like.

Idk about the internals of Vertico or mini-frame etc.., so I won't be able to make a PR, bcs I am a beginner at Emacs, but for the meantime I will comment the vertico-multiform stuff out in my config so I can use M-x. I'll leave this issue here anyway.

What is your theme?

Hello there!

I have this setup with emacs-mini-frame and ivy-mode, but I can barely see what is selected.

image

image

I had no success with any dark themes :( , so I'd like to know what theme you are using on the README. :)

Thanks!

Advicing read-string breaks input-methods in isearch

Way to reproduce:

  • M-x set-input-method cyrillic-jucken
  • C-s type something.

Expected results: cyrillic characters.

Observed behavior: latin characters, blinking/redrawing echo area.

A hacky solution: remove read-string from mini-frame-advice-functions.

Does not work on terminal emacs

Doesn't seem to work on terminal emacs. When I enable the mode in terminal emacs vs using my init file, it does not work.

[Ubuntu] Leaving Emacs moves point out of mini-frame

From emacs -Q, evaluate the following code:

(require 'package)
(package-initialize)
(require 'mini-frame)
(mini-frame-mode t)

Then:

  1. Type C-x b. A mini-frame opens prompting to switch to a new buffer. Point is in that frame.
  2. Change focus away from Emacs, to any other window. Focus could be changed with Alt-tab or the mouse.
  3. Change focus back to Emacs. Again, this could be done with Alt-tab or the mouse.
  4. Note that focus is no longer in the mini-frame, but back in the original window point was in before we typed C-x b.

I'm running mini-frame from version 31380e7.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.