December 13, 2025
Nearly a couple of weeks since the last Bending Emacs episode, so here’s a new episode:
Bending Emacs Episode 8: completing-read
In this video, we take a look at the humble but mighty completing-read function. We can use it to craft our purpose-built tools, whether in pure elisp or to interact with command-line utilities.
Of interest, I also highlighted the great elisp-demos package, which extends your help buffers with sample snippets.
Here are some of the completing-read snippets we played with:
Pick a queen:
(completing-read "Pick a Queen: "
'("Queen of Hearts ♥"
"...
December 13, 2025
Nearly a couple of weeks since the last Bending Emacs episode, so here’s a new episode:
Bending Emacs Episode 8: completing-read
In this video, we take a look at the humble but mighty completing-read function. We can use it to craft our purpose-built tools, whether in pure elisp or to interact with command-line utilities.
Of interest, I also highlighted the great elisp-demos package, which extends your help buffers with sample snippets.
Here are some of the completing-read snippets we played with:
Pick a queen:
(completing-read "Pick a Queen: "
'("Queen of Hearts ♥"
"Queen of Spades ♠"
"Queen of Clubs ♣"
"Queen of Diamonds ♦")
;; predicate
nil
;; require match
t)
Our own hashing function with an algo picker:
(defun misc/hash-region ()
(interactive)
(message "Hash: %s" (secure-hash (intern (completing-read
"Hash type: "
'(md5 sha1 sha224 sha256 sha384 sha512)))
(current-buffer)
(when (use-region-p)
(region-beginning))
(when (use-region-p)
(region-end)))))
A first look at integrating completing read with a CLI util:
(completing-read "Select file: "
(string-split (shell-command-to-string "ls -1 ../") "\n"))
Also got creative with BluetoothConnector on macOS and completing-read.
(completing-read "Toggle BT connection: "
(mapcar (lambda (device)
;; Extract device name
(nth 1 (split-string device " - ")))
(seq-filter
(lambda (line)
;; Keep lines like: af-8c-3b-b1-99-af - Device name
(string-match-p "^[0-9a-f]\\{2\\}" line))
(split-string (shell-command-to-string "BluetoothConnector") "\n"))))
Some of my completing-read uses:
Emacs: quickly killing processes.
Emacs: insert and render SF symbols.
macOS open with.
macOS set default app.
macOS share (the unhinged way).
ready-player search.
Hope you enjoyed the video!
Want more videos?
Liked the video? Please let me know. Got feedback? Leave me some comments.
Please go like my video, share with others, and subscribe to my channel.
If there’s enough interest, I’ll continue making more videos!
Make it all sustainable
Enjoying this content or my projects? I am an indie dev. Help make it sustainable by ✨sponsoring✨
Need a blog? I can help with that. Maybe buy my iOS apps too ;)
powered by LMNO.lol