When writing text, I would like not to have to press "Shift" when, say, the preceding text is a sentence end (e.g., ". ").

So, for example, if I have written Hi. and then I type b, a B should appear on the buffer.

I imagine this could be done by advising self-insert-command or expand-abbrev.

It is important that the solution works well with abbreviations. So, if b is expanded into "bye", then typing b in the previous example should expand into Bye.

I don't want to use the auto-capitalize package, as it is noticeably slow and sometimes incompatible with other packages.

  • Modifying self-insert-command will most likely not end well, however, there's a hook that runs after this function is called: gnu.org/software/emacs/manual/html_node/elisp/… . But I have to confess, I don't know in what order does Emacs call this hook related to abbrev expansion, and whether this hook is called after the expansion. – wvxvw May 3 '15 at 4:56
  • I had success by re-binding keys 'a'-'z' to my own self-insert-command which checks whether to upcase or not the last-command-event and then calls interactively the normal self-insert-command. – scaramouche May 3 '15 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.