From: Masatake YAMATO Date: Mon, 9 Apr 2007 12:34:57 +0000 (+0000) Subject: Install a patch from Paul Curry. X-Git-Tag: emacs-pretest-22.0.98~177 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=287787ee7bfb0b1e3178b93745a036206a26fba6;p=emacs.git Install a patch from Paul Curry. (c-downcase-subword, c-upcase-subword): Don't move point if ARG is netagive. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1b7c973cba..473cb45cf28 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-04-09 Paul Curry (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 Changes to make `narrow-to-defun' and `mark-defun' work properly diff --git a/lisp/progmodes/cc-subword.el b/lisp/progmodes/cc-subword.el index 29494fdc6a7..9bdd991982b 100644 --- a/lisp/progmodes/cc-subword.el +++ b/lisp/progmodes/cc-subword.el @@ -218,6 +218,28 @@ Optional argument ARG is the same as for `transpose-words'." (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 @@ Optional argument ARG is the same as for `capitalize-word'." (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))) ;;