Hacking y-or-n-p

Marcin Borkowski (mbork) has a short post on how to make y-or-n-p return t when the user types Return. Check his post for the details but the TL;DR is that he temporarily extends the y-or-n-p keymap to have Return return as if y had been pressed.

It’s a fairly unique requirement but his approach works for other use cases where we want to add or change a key to an existing keymap. If you have such a need, take a look at mbork’s post.

As an aside, I should mention that mbork’s new book is finished and available. I read a draft of his early chapters and thought it was well done. Take a look if you’re interested in Emacs books.

This entry was posted in General and tagged . Bookmark the permalink.