There are a number of packages that provide functionality to display inline information in the buffer. The builtin package eldoc
will display information about the current function at point below the modeline, which is often sufficient, but not quite a popup.
The most common approach for selectively displaying information inline or near the current point, is to use an overlay, which are attributes attached to a range of characters. Take a look at how company.el uses the functions overlay-get
and overlay-put
to attach properties to the text near a popup, and change the face of the text depending on where the point is.
If you are looking for a library that encapsulates this behavior using overlays, take a look at popup.el, or quick-peek. There are other approaches as well, eldoc-box appears to be using a childframe triggered by an overlay. That said, many of the help systems in emacs provide context information in a temporary popup buffer. It may be worth trying that approach first.
Providing more context on what you intend to use the popup for might help in selecting which of these is appropriate for your task.