GNU ELPA - posframe


Pop a posframe (just a frame) at point
posframe-1.0.4.tar, 2021-Jun-16, 140 KiB
Feng Shu <>
Home page
Browse ELPA's repository
CGit or Gitweb

To install this package, run in Emacs:

M-x package-install RET posframe RET

Full description

# Created 2021-06-01 Tue 10:41
#+TITLE: Pop a posframe (just a frame) at point
#+AUTHOR: Feng Shu

#+html: <a href=""><img alt="GNU ELPA" src=""/></a>
#+html: <a href=""><img alt="GNU-devel ELPA" src=""/></a>
#+html: <a href=""><img alt="MELPA" src=""/></a>

* What is posframe?
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:
1. It is fast enough for daily usage :-)
2. It works well with CJK languages.

1. For MacOS users, posframe needs Emacs version >= 26.0.91
2. GNOME users with GTK3 builds need Emacs 27 or later.
   See variable `posframe-gtk-resize-child-frames'
   which auto-detects this configuration.

   More details:
   1. [[][Fix some problems with moving and resizing child frames]]
   2. [[][Emacs's set-frame-size can not work well with gnome-shell?]]


* Installation

(require 'posframe)

* Usage

** Create a posframe

*** Simple way
(when (posframe-workable-p)
  (posframe-show " *my-posframe-buffer*"
                 :string "This is a test"
                 :position (point)))

*** Advanced way
(defvar my-posframe-buffer " *my-posframe-buffer*")

(with-current-buffer (get-buffer-create my-posframe-buffer)
  (insert "Hello world"))

(when (posframe-workable-p)
  (posframe-show my-posframe-buffer
                 :position (point)))

*** Arguments

C-h f posframe-show

** Hide a posframe
(posframe-hide " *my-posframe-buffer*")

** Hide all posframes
M-x posframe-hide-all

** Delete a posframe
1. Delete posframe and its buffer
   (posframe-delete " *my-posframe-buffer*")
2. Only delete the frame
   (posframe-delete-frame " *my-posframe-buffer*")
** Delete all posframes
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.

** Customizing mouse pointer control

By default, posframe moves the pointer to point (0,0) in
the frame, as a way to address an issue with mouse focus.
To disable this feature, add this to your init.el:
(setq posframe-mouse-banish nil)

** Set fallback arguments of posframe-show

Users can set fallback values of posframe-show's arguments with the
help of `posframe-arghandler'.  The example below sets fallback
border-width to 10 and fallback background color to green.

(setq posframe-arghandler #'my-posframe-arghandler)
(defun my-posframe-arghandler (buffer-or-name arg-name value)
  (let ((info '(:internal-border-width 10 :background-color "green")))
    (or (plist-get info arg-name) value)))

Old versions

posframe-1.0.3.tar.lz2021-May-3175.4 KiB
posframe-1.0.2.tar.lz2021-Apr-2375.4 KiB
posframe-1.0.1.tar.lz2021-Apr-1675.4 KiB
posframe-1.0.0.tar.lz2021-Apr-1075.4 KiB
posframe-0.9.0.tar.lz2021-Mar-3174.6 KiB
posframe-0.8.8.tar.lz2021-Mar-1174.6 KiB
posframe-0.8.7.tar.lz2021-Mar-0374.6 KiB
posframe-0.8.6.tar.lz2021-Mar-0274.6 KiB
posframe-0.8.5.tar.lz2021-Feb-0874.6 KiB
posframe-0.8.4.tar.lz2021-Jan-1373.8 KiB
posframe-0.8.3.el.lz2020-Nov-1810.7 KiB
posframe-0.8.0.el.lz2020-Aug-1810.7 KiB
posframe-0.7.0.el.lz2020-Apr-059.53 KiB
posframe-0.6.0.el.lz2020-Feb-059.32 KiB
posframe-0.5.0.el.lz2019-Jun-098.77 KiB
posframe-0.4.3.el.lz2019-Mar-138.32 KiB
posframe-0.4.2.el.lz2018-Dec-147.00 KiB
posframe-0.3.0.el.lz2018-Mar-096.12 KiB
posframe-0.2.0.el.lz2018-Mar-086.07 KiB
posframe-0.1.0.el.lz2018-Feb-275.83 KiB