0
|
1 (defun SeLF-insert-command (arg)
|
|
2 "Insert the character you TyPE.
|
|
3 Whichever character you TyPE to run ThIS command is inserted."
|
|
4 (interactive "p")
|
|
5 (let ((p (point))
|
|
6 (case-fold-search nil))
|
|
7 (self-insert-command arg)
|
|
8 (save-excursion
|
|
9 (goto-char p)
|
|
10 (skip-chars-backward " \t\r\n")
|
|
11 (if (condition-case () (forward-char -4) (error t))
|
|
12 nil
|
|
13 (if (looking-at "\\<[A-Za-z][a-z][a-z][a-z][^A-Za-z]")
|
|
14 (progn
|
|
15 (insert (upcase (following-char))) (delete-char 1)
|
|
16 (forward-char 1)
|
|
17 (insert (upcase (following-char))) (delete-char 1)
|
|
18 (insert (upcase (following-char))) (delete-char 1)))))))
|
|
19
|
|
20 (define-key text-mode-map " " 'SeLF-insert-command)
|
|
21 (define-key text-mode-map "," 'SeLF-insert-command)
|
|
22 (define-key text-mode-map "." 'SeLF-insert-command)
|
|
23 (define-key text-mode-map "!" 'SeLF-insert-command)
|
|
24 (define-key text-mode-map "-" 'SeLF-insert-command)
|
|
25 (define-key text-mode-map "_" 'SeLF-insert-command)
|
|
26 (define-key text-mode-map ";" 'SeLF-insert-command)
|
|
27 (define-key text-mode-map ":" 'SeLF-insert-command)
|