0. Install the GNU ELPA package caps-lock. 1. emacs -Q 2. M-x package-initialize 3. Start an SQL inferior process, e.g. with `M-x sql-sqlite RET test RET'. 4. In the *SQL: SQLite* buffer type `M-x caps-lock-mode' and at sqlite> prompt type "select * from". => The typed text appears as this: "SELECT * FRoM", with a lowercase "o" instead of an uppercase "O". This is because sql-interactive-mode-map binds both "o" and "O" to the command `sql-magic-go', but caps-lock-mode changes case only if the last key event either invoked `self-insert-command' or `isearch-printing-char' or if the command it invoked remaps self-insert-command, and since neither is the case here, no case change occurs. (You can of course enter "O" by typing S-o, but caps-lock-mode is supposed to obviate the need to do that.) This problem also happens with PostgreSQL and presumably other SQL interpreters supported by sql.el (but I have only tested SQLite and PostgreSQL). I have found two ways to fix this problem. One is simply to add `sql-magic-go' to the list `caps-lock-commands'. In caps-lock.el this is a defvar with the value '(self-insert-command isearch-printing-char). Instead of just changing this value in the source code, I think it would be better to make the variable a defcustom, since many packages bind letter keys to commands other than `self-insert-command' but may nevertheless want to change the case of these letters when caps-lock-mode is enabled. So it would be up to the user to add `sql-magic-go' to the value. Here's a patch that allows this (I don't have a local clone of the GNU ELPA repo, so it's just a plain diff):