[lice @ more rearranging. define-key modifications to accomodate bindings.lisp. this...
[lice.git] / src / casefiddle.lisp
blobdeedaab8146e70b3f38d494f72fefe92530188b0
1 (in-package "LICE")
3 ;; FIXME: these case functions don't handle characters or propertized strings
4 (defun upcase (obj)
5 "Convert argument to upper case and return that.
6 The argument may be a character or string. The result has the same type.
7 The argument object is not altered--the value is a copy.
8 See also `capitalize', `downcase' and `upcase-initials'."
9 (string-upcase obj))
11 (defun downcase (obj)
12 "Convert argument to lower case and return that.
13 The argument may be a character or string. The result has the same type.
14 The argument object is not altered--the value is a copy."
15 (string-downcase obj))
17 (defun capitalize (obj)
18 "Convert argument to capitalized form and return that.
19 This means that each word's first character is upper case
20 and the rest is lower case.
21 The argument may be a character or string. The result has the same type.
22 The argument object is not altered--the value is a copy."
23 (string-capitalize obj))
25 (defun upcase-initials (obj)
26 "Convert the initial of each word in the argument to upper case.
27 Do not change the other letters of each word.
28 The argument may be a character or string. The result has the same type.
29 The argument object is not altered--the value is a copy."
30 ;; FIXME: don't touch the other letters. only the first one.
31 (string-capitalize obj))
33 (defun upcase-region (beg end)
34 (declare (ignore beg end))
35 (error "Unimplemented"))
36 (setf (get 'upcase-region 'disabled) t)
38 (defun downcase-region ()
39 (error "Unimplemented"))
40 (setf (get 'downcase-region 'disabled) t)
42 (defun capitalize-region ()
43 (error "Unimplemented"))
45 (defun upcase-initials-region ()
46 (error "Unimplemented"))
48 (defun upcase-word ()
49 (error "Unimplemented"))
51 (defun downcase-word ()
52 (error "Unimplemented"))
54 (defun capitalize-word ()
55 (error "Unimplemented"))
57 ;;; Key bindings
59 (define-key *ctl-x-map* "C-u" 'upcase-region)
60 (define-key *ctl-x-map* "C-l" 'downcase-region)
61 (define-key *global-map* "M-u" 'upcase-word)
62 (define-key *global-map* "M-l" 'downcase-word)
63 (define-key *global-map* "M-c" 'capitalize-word)