Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Alexander-Miller/cfrs
Child Frame Read String
https://github.com/Alexander-Miller/cfrs
emacs input utils
Last synced: about 2 months ago
JSON representation
Child Frame Read String
- Host: GitHub
- URL: https://github.com/Alexander-Miller/cfrs
- Owner: Alexander-Miller
- License: gpl-3.0
- Created: 2019-05-20T19:36:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-29T11:33:23.000Z (almost 3 years ago)
- Last Synced: 2024-11-18T21:52:59.875Z (2 months ago)
- Topics: emacs, input, utils
- Language: Emacs Lisp
- Homepage:
- Size: 62.5 KB
- Stars: 59
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
# -*- fill-column: 120 org-list-indent-offset: 1 -*-
#+STARTUP: noinlineimages* cfrs.el -- Child Frame Read String
[[file:cfrs.png]]
cfrs.el is a simple alternative to ~read-string~ that allows reading input via a small child-frame spawned at the
position of the cursor. Its goal is to make the string input interface closer to those used in modern GUI programs and
to help the user with having to switch focus from whatever they are doing currently to look at the minibuffer.There is just one single entry point, ~cfrs-read~, and its interface simple enough to not require further explanation:
#+BEGIN_SRC emacs-lisp
(defun cfrs-read (prompt &optional initial-input) ... )
#+END_SRCThe text in the resulting child-frame can be edited freely, with the caveat that it is meant to fit on a single line -
cfrs.el is meant for /simple/ inputs. The input can be confirmed via either ~C-c C-c~ or ~RET~.A runnable example:
#+BEGIN_SRC emacs-lisp
(let ((input (cfrs-read "Text: " "Initial Input")))
(message "Hello %s!" input))
#+END_SRCIn a terminal environment cfrs will fall back to the default ~read-string~.