emacs: how to cap the first letter of sentences?

Elena wrote:
> how can I autocapitalize the first word in a sentence (that is, after
> a period)?
> I've searched the Emacs Wiki, but:
> - auto-cap.el doesn't work;
> - auto-capitalize.el raises an error after the first word, then it
> doesn't work anymore.
> Thanks

without using a special package, you can do it by simply use query-replace-regexp, with pattern like this: “\. +.”, and in the replacement string give this: “\,(upcase \1)”.

For detail, see bottom:

• Find and Replace with Emacs

∑ http://xahlee.org/

No comments:

Post a Comment