Closed foodeater123 closed 2 years ago
Yes, at the moment, posframe do not get focus, so it only can show and can not select and edit.
Would there be any workaround to this, if posframe can have focus it would be possible for even a pop up shell. How do modes like posframe vertico focus on the pop up
I do not know more about focus, may be you can read code and try, forcus seem to hard deal with
maybe you should search package list, maybe other package has this feature
Is there any temporary workaround
@RadonBurner It seems you can edit the buffer in posframe by having :accept-focus t
in posframe-show
. I don't know if this is correct usage though.
@zhenhua-wang Thanks, is there anyway to to show cursor when focusing, I got the cursor to show with (with-current-buffer buffer (setq-local cursor-type t) (setq-local cursor-in-non-selected-windows 'box))
but the cursor does not move when I type or use arrow keys, it just sits there
What you did above was correct. You also need to set :override-parameters '((cursor-type . box))
inside posframe-show
.
I had a idea to make the scratch buffer pop up for temporary notes using posframe, however when it pop ups it does not allow me to edit the text on the posframe frame itself.
Code: (defun show-misc-posframe () (interactive) (when (posframe-workable-p) (posframe-show "scratch" :border-color "#ee7b29" :border-width 2 :poshandler 'posframe-poshandler-frame-center :height (round( (frame-height) 0.90)) :width (round( (frame-width) 0.75)) ; :override-parameters '((cursor-type box)) ) ) (with-current-buffer "scratch" (setq-local cursor-type t) (setq-local cursor-in-non-selected-windows 'box)) )