I use Emacs auto-capitalize-mode, which works perfectly most of the time except for ...
(ellipsis), and words like e.g.
and i.e.
.
If I write a sentence... and then another part... and then another part... auto-capitalize-mode mistakenly capitalizes it like so:
"If I write a sentence... And then another part... And then another part..."
How do I tell auto-capitalize-mode not to capitalize after ellipsis?
Same question for e.g.
and i.e.
auto-capitalize-mode
uses the Emacs default mechanism for determining the end of a sentence, which in turn relies on some regexps customizable in the paragraphs group; tryM-x customize-group RET paragraphs RET
and examine the values of the 'Sentence End.*' variables, in particular 'Sentence End Base'. I can't suggest a possible change to the value, but that'd be a likely place to start; if you need to change just the behavior of auto-capitalize-mode, rather than that of Emacs as a whole, you'd want to look at advising the functionauto-capitalize-sentence-end
.e.g.
ori.e.
automatically call a function? A function which would insert those characters and then automatically lowercase the following word?M-x edit-abbrevs
, which visits the abbrevs table list. Each abbrev is defined as NAME USECOUNT EXPANSION HOOK, where HOOK is empty by default; you'd define "i.e." as an abbrev which expands to itself, and whose hook finds the word following the abbrev and downcases it. Once you're done editing the abbrev table entry,C-c C-c
will apply the change in your current session, andC-x C-s
saves the file.(lambda nil (save-excursion (forward-word) (push-mark) (backward-word) (downcase-region (point) (mark))))
Of course this only works on things Emacs recognizes as a "word", so a hyphenated compound, for example, would only have its first part downcased; if that's a concern, you probably want to replace this simple-minded effort with something that looks at whitespace and non-infix punctuation instead."e.g." 0 "e.g." (lambda nil (...))
, with the placeholder filled by the lambda given in my previous comment. FYI, enteringe.g.
into a buffer, followed byC-x a i g
(INVERSE-ADD-GLOBAL-ABBREV), tries to add an abbrev ong.
;C-u 2 C-x a i g
, which should add an abbrev on the two "words" preceding point, instead tries to add an abbrev one.
. I'm not sure why that doesn't work the way it seems like it should, but the misbehavior might offer some insight, which is why I mention it here. Hope this helps!