Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/karimaziev/momentary-popup

Display momentary popup in emacs.
https://github.com/karimaziev/momentary-popup

emacs popup

Last synced: 4 days ago
JSON representation

Display momentary popup in emacs.

Awesome Lists containing this project

README

        

* momentary-popup
The package provides functions similar to ~momentary-string-display~ but inside popup windows.

** Installation

Download the repository and add it to your ~load-path~.
#+begin_src elisp

(add-to-list 'load-path "/path/to/momentary-popup/")

(require 'momentary-popup)

(define-key momentary-popup-switch-keymap (kbd "C-c C-o") 'momentary-popup-open-inspector)

#+end_src
Or with ~use-package~ and ~straight-use-package~:

#+begin_src elisp
(use-package momentary-popup
:straight (:repo "KarimAziev/momentary-popup" :type git :host github)
:hook ((momentary-popup-mode . visual-line-mode)
(momentary-popup-inspect-mode . visual-line-mode))
:bind ((:map momentary-popup-switch-keymap
("C-c o" . momentary-popup-open-inspector))
(:map momentary-popup-inspect-keymap
("C-c C-o" . momentary-popup-maybe-find-file))))
#+end_src

** Main functions and commands:

+ ~momentary-popup~ (content &rest setup-args)

Momentarily display CONTENT in popup window.

Display remains until next event is input.

To persist popup type key binding from ~momentary-popup-switch-keymap~ for command ~momentary-popup-open-inspector~ (by default (kbd "C-c C-o") and (kbd "C-c o")).

SETUP-ARGS can includes keymaps, syntax table, filename and function.

+ ~momentary-popup-file~ (file)
Momentarily display content of the FILE in popup window.

Display remains until next event is input.

+ ~momentary-popup-open-inspector~
Open or restore popup in a buffer `momentary-popup-inspect-buffer-name'.

** Keymaps:

+ ~momentary-popup-switch-keymap~
Keymap with commands to execute just before quiting momentary popup. Defaults:

| Default Key | Command |
|-------------+--------------------------------|
| C-c C-o | open content in inspect buffer |

+ ~momentary-popup-inspect-keymap~
Inspect buffer uses ~momentary-popup-inspect-keymap~ with next defaults:

| Default Key | Command |
|-------------+--------------------------------------------------------------------|
| C-c C-o | find existing file from setup args |
| C-x 0 | kill inspect buffer |
| q | if inspect buffer is readonly kill it, else it self-insert-command |

Keymap with commands to execute just before quiting momentary popup. Defaults: