changeset 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 e8bd3e011b64
children 304a180098d2
files lisp/ChangeLog lisp/progmodes/cc-subword.el
diffstat 2 files changed, 27 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Apr 09 10:51:29 2007 +0000
+++ b/lisp/ChangeLog	Mon Apr 09 12:34:57 2007 +0000
@@ -1,3 +1,8 @@
+2007-04-09  Paul Curry <dashteacup@gmail.com>  (tiny change)
+
+	* progmodes/cc-subword.el (c-downcase-subword, c-upcase-subword): 
+	Don't move point if ARG is netagive.
+
 2007-04-09  Alan Mackenzie  <acm@muc.de>
 
 	Changes to make `narrow-to-defun' and `mark-defun' work properly
--- 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)))
 
 
 ;;