Posframe can pop up a frame at point, this posframe is a child-frame connected to its root window’s buffer.
The main advantages are:
- It is fast enough for daily usage :-)
- It works well with CJK languages.
NOTE:
- For MacOS users, posframe needs Emacs version >= 26.0.91
- GNOME users with GTK3 builds need Emacs 27 or later.
See variable `posframe-gtk-resize-child-frames’
which auto-detects this configuration.
More details:
(require 'posframe)
(when (posframe-workable-p) (posframe-show " *my-posframe-buffer*" :string "This is a test" :position (point)))
(defvar my-posframe-buffer " *my-posframe-buffer*") (with-current-buffer (get-buffer-create my-posframe-buffer) (erase-buffer) (insert "Hello world")) (when (posframe-workable-p) (posframe-show my-posframe-buffer :position (point)))
C-h f posframe-show
(posframe-hide " *my-posframe-buffer*")
M-x posframe-hide-all
- Delete posframe and its buffer
(posframe-delete " *my-posframe-buffer*")
- Only delete the frame
(posframe-delete-frame " *my-posframe-buffer*")
M-x posframe-delete-all
Note: this command will delete all posframe buffers. You probably shouldn’t use it if you are sharing a buffer between posframe and other packages.
posframe-arghandler feature has been removed from posframe-1.1, user can use advice feature instead.
Default setting will work well in most case, but for EXWM user, suggest use the below config.
(setq posframe-mouse-banish-function #'posframe-mouse-banish-simple)