Weekly Emacs tip #23 — Configure Emacs to accept short answers
A short one this time.
For some questions — for example, if there are still unsaved buffers when you exit Emacs — Emacs will ask you to confirm by typing yes
or no
. While this helps against mistakes, I also find it annoying to have to type the whole word — even though we’re only talking about two or three letters.
Luckily, since Emacs 28 there is a simple solution to this. Simply add the following to your ~/.emacs
file:
(setopt use-short-answers t)
With that option set, a simple y
or n
suffices.
If, like me, you organise your Emacs config file with use-package
, you can set the option in the :custom
section of your (use-package emacs)
block:
(use-package emacs :custom ;; Always ask for y/n keypress instead of typing out 'yes' or 'no' (use-short-answers t) )
No Comments