all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.