diff lisp/progmodes/cc-subword.el @ 77082:c783ccac00cf

Install a patch from Paul Curry. (c-downcase-subword, c-upcase-subword): Don't move point if ARG is netagive.
author Masatake YAMATO <jet@gyve.org>
date Mon, 09 Apr 2007 12:34:57 +0000
parents e3694f1cb928
children 304a180098d2
line wrap: on
line diff
--- a/lisp/progmodes/cc-subword.el	Mon Apr 09 10:51:29 2007 +0000
+++ b/lisp/progmodes/cc-subword.el	Mon Apr 09 12:34:57 2007 +0000
@@ -218,6 +218,28 @@
   (interactive "*p")
   (transpose-subr 'c-forward-subword arg))
 
+
+
+(defun c-downcase-subword (arg)
+  "Do the same as `downcase-word' but on subwords.
+See the command `c-subword-mode' for a description of subwords.
+Optional argument ARG is the same as for `downcase-word'."
+  (interactive "p")
+  (let ((start (point)))
+    (downcase-region (point) (c-forward-subword arg))
+    (when (< arg 0) 
+      (goto-char start))))
+
+(defun c-upcase-subword (arg)
+  "Do the same as `upcase-word' but on subwords.
+See the command `c-subword-mode' for a description of subwords.
+Optional argument ARG is the same as for `upcase-word'."
+  (interactive "p")
+  (let ((start (point)))
+    (upcase-region (point) (c-forward-subword arg))
+    (when (< arg 0) 
+      (goto-char start))))
+
 (defun c-capitalize-subword (arg)
   "Do the same as `capitalize-word' but on subwords.
 See the command `c-subword-mode' for a description of subwords.
@@ -237,19 +259,6 @@
 	(downcase-region pp np)
 	(goto-char np)))))
 
-(defun c-downcase-subword (arg)
-  "Do the same as `downcase-word' but on subwords.
-See the command `c-subword-mode' for a description of subwords.
-Optional argument ARG is the same as for `downcase-word'."
-  (interactive "p")
-  (downcase-region (point) (c-forward-subword arg)))
-
-(defun c-upcase-subword (arg)
-  "Do the same as `upcase-word' but on subwords.
-See the command `c-subword-mode' for a description of subwords.
-Optional argument ARG is the same as for `upcase-word'."
-  (interactive "p")
-  (upcase-region (point) (c-forward-subword arg)))
 
 
 ;;