Emacs Hack: Typing Uppercase Without CAPS LOCK
I wanted to write all my FORTH code for a project in uppercase. (Hey, it's my project, alright!?) However, using the CAPS LOCK key in Emacs is a bit annoying, because the minibuffer commands are case sensitive, meaning that you have to disable CAPS LOCK first before using any M-x command.
With the help of the friendly folks at #emacs on libera.chat, I was able to figure out this workaround: drop this code into a ".dir-locals.el" file in the directory where your source code is kept:
((forth-mode . ((input-method-function
. (lambda (b)
(list (upcase b)))))))
That assumes that you have FORTH mode installed. You can replace "forth-mode" with any other mode name.
If you hack this hack, you'll want to be careful not to set this variable globally, as then the input to the minibuffer will also be converted to uppercase, and you won't be able to enter any more M-x commands during your session.