I would like to be able to navigate by sentence in Emacs (M-a, M-e). Here's the problem: by default, Emacs expects that each sentence is separated by two spaces, and I'm used to just putting a single space. Of course, that setting can be turned off, to allow for sentences separated by only a single space, like so:
(setq sentence-end-double-space nil)
But then Emacs thinks that a sentence has ended after abbreviations with a full stop ("."), e.g. after something like "...a weird command, e.g. foo...".
So rather than using the above code, is there a way to define the sentence-end variable so that it counts [.!?] as marking the end of the sentence, iff what follows is one or more spaces followed by a capital letter [A-Z]?
And...to also allow [.!?] to mark the end of a sentence, if followed by zero or more spaces followed by a "\"? [The reason for this latter condition is for writing LaTeX code: where a sentence is followed by a LaTeX command like \footnote{}, e.g. "...and so we can see that the point is proved.\footnote{In some alternate world, at least.}"]
I tried playing around with the definition of sentence-end, and came up with:
(setq sentence-end "[.!?][]'\")}]*\\(\\$\\|[ ]+[A-Z]\\|[ ]+[A-Z]\\| \\)[
;]*")
But this doesn't seem to work at all.
Any suggestions?