* Simple minded auto capitalize
@ 2007-11-09 17:21 weber
0 siblings, 0 replies; only message in thread
From: weber @ 2007-11-09 17:21 UTC (permalink / raw)
To: help-gnu-emacs
Hey guys..
I just came up with this:
(define-key text-mode-map (kbd ".") '(lambda () (interactive) (auto-
capitalize-char ".")))
(define-key text-mode-map (kbd ":") '(lambda () (interactive) (auto-
capitalize-char ":")))
(define-key text-mode-map (kbd "?") '(lambda () (interactive) (auto-
capitalize-char "?")))
(define-key text-mode-map (kbd "!") '(lambda () (interactive) (auto-
capitalize-char "!")))
(defun auto-capitalize-char (char)
"CHAR indicates end of sentence, so go back and capitalize
sentence."
(interactive)
(save-excursion (backward-sentence 1)
(capitalize-word 1))
(insert char))
and given the little code needed, that it's a big help when typing
text!
Is this interesting enought to be posted on the wiki? Does it already
exists?
Cheers,
weber
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-11-09 17:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09 17:21 Simple minded auto capitalize weber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).