https://github.com/nemethf/single-key-completion
Emacs completion with a single keystroke
https://github.com/nemethf/single-key-completion
Last synced: 7 months ago
JSON representation
Emacs completion with a single keystroke
- Host: GitHub
- URL: https://github.com/nemethf/single-key-completion
- Owner: nemethf
- License: gpl-3.0
- Created: 2020-01-18T14:14:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-20T21:16:10.000Z (over 6 years ago)
- Last Synced: 2025-02-01T04:14:54.775Z (over 1 year ago)
- Language: Emacs Lisp
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Emacs completion with a single keystroke
single-key-completion provides `single-key-completing-read`, which can
be used as a `completing-read-function`. With the help of tmm.el, it
assigns a single-key shortcut to each completion candidate when there
is only a handful of completion candidates. When there are lots of
candidates, tmm runs out of shortcuts and `single-key-completing-read`
calls `single-key-fallback-function`. `C-b` forces the fallback.
# Example of localized usage
````elisp
(define-advice eglot-code-actions (:around (oldfun &rest args) single-key)
(let ((single-key-fallback-function completing-read-function)
(completing-read-function #'single-key-completing-read))
(apply oldfun args)))
;; Uninstall it later...
(advice-remove 'eglot-code-actions 'eglot-code-actions@single-key)
````
# License
[GPLv3+][gpl]
[gpl]: COPYING