4
|
1 ;;; NeXTify.el --- Character insertion variation
|
|
2
|
|
3 ;; Copyright status unknown
|
|
4
|
|
5 ;; Author: Unknown
|
|
6 ;; Keywords: games
|
|
7
|
|
8 ;; This file is part of XEmacs.
|
|
9
|
|
10 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
11 ;; under the terms of the GNU General Public License as published by
|
|
12 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
13 ;; any later version.
|
|
14
|
|
15 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
18 ;; General Public License for more details.
|
|
19
|
|
20 ;; You should have received a copy of the GNU General Public License
|
|
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
23 ;; 02111-1307, USA.
|
|
24
|
|
25 ;;; Synched up with: Not in FSF
|
|
26
|
|
27 ;;; Commentary:
|
|
28
|
|
29 ;;; Code:
|
0
|
30 (defun SeLF-insert-command (arg)
|
|
31 "Insert the character you TyPE.
|
|
32 Whichever character you TyPE to run ThIS command is inserted."
|
|
33 (interactive "p")
|
|
34 (let ((p (point))
|
|
35 (case-fold-search nil))
|
|
36 (self-insert-command arg)
|
|
37 (save-excursion
|
|
38 (goto-char p)
|
|
39 (skip-chars-backward " \t\r\n")
|
|
40 (if (condition-case () (forward-char -4) (error t))
|
|
41 nil
|
|
42 (if (looking-at "\\<[A-Za-z][a-z][a-z][a-z][^A-Za-z]")
|
|
43 (progn
|
|
44 (insert (upcase (following-char))) (delete-char 1)
|
|
45 (forward-char 1)
|
|
46 (insert (upcase (following-char))) (delete-char 1)
|
|
47 (insert (upcase (following-char))) (delete-char 1)))))))
|
|
48
|
|
49 (define-key text-mode-map " " 'SeLF-insert-command)
|
|
50 (define-key text-mode-map "," 'SeLF-insert-command)
|
|
51 (define-key text-mode-map "." 'SeLF-insert-command)
|
|
52 (define-key text-mode-map "!" 'SeLF-insert-command)
|
|
53 (define-key text-mode-map "-" 'SeLF-insert-command)
|
|
54 (define-key text-mode-map "_" 'SeLF-insert-command)
|
|
55 (define-key text-mode-map ";" 'SeLF-insert-command)
|
|
56 (define-key text-mode-map ":" 'SeLF-insert-command)
|
4
|
57
|
|
58 ;;; NeXTify.el ends here
|