Function: tpu-change-case
tpu-change-case is an interactive and byte-compiled function defined
in tpu-edt.el.gz.
Signature
(tpu-change-case NUM)
Documentation
Change the case of the character under the cursor or region.
Accepts a prefix argument of the number of characters to invert.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/tpu-edt.el.gz
;;;
;;; Miscellaneous
;;;
(defun tpu-change-case (num)
"Change the case of the character under the cursor or region.
Accepts a prefix argument of the number of characters to invert."
(interactive "p")
(cond ((tpu-mark)
(let ((beg (region-beginning)) (end (region-end)))
(while (> end beg)
(funcall (if (= (downcase (char-after beg)) (char-after beg))
'upcase-region 'downcase-region)
beg (1+ beg))
(setq beg (1+ beg)))
(tpu-unselect t)))
((tpu-check-match)
(let ((beg (tpu-match-beginning)) (end (tpu-match-end)))
(while (> end beg)
(funcall (if (= (downcase (char-after beg)) (char-after beg))
'upcase-region 'downcase-region)
beg (1+ beg))
(setq beg (1+ beg)))
(tpu-unset-match)))
(t
(while (> num 0)
(funcall (if (= (downcase (following-char)) (following-char))
'upcase-region 'downcase-region)
(point) (1+ (point)))
(forward-char (if tpu-reverse -1 1))
(setq num (1- num))))))