I wrote a small Emacs Lisp library, titlecase.el for converting text to title case in Emacs. It provides three functions:
titlecase-stringconverts a given string to title case and returns the result.
titlecase-regionconverts the given region to title case.
titlecase-dwimconverts the region to title case, if there is an active region, or converts the current line to title case.
Rather than reinvent the wheel, this library is currently a wrapper
for the titlecase Perl script written by John Gruber and Aristotle
Pagaltzis. Place the
titlecase script in a directory that’s in your
exec-path and make sure it’s executable. Otherwise, you’ll
need to change the value of the variable
titlecase-command to be the
full path to the script on your system.