Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
77081:e8bd3e011b64 | 77082:c783ccac00cf |
---|---|
216 See the command `c-subword-mode' for a description of subwords. | 216 See the command `c-subword-mode' for a description of subwords. |
217 Optional argument ARG is the same as for `transpose-words'." | 217 Optional argument ARG is the same as for `transpose-words'." |
218 (interactive "*p") | 218 (interactive "*p") |
219 (transpose-subr 'c-forward-subword arg)) | 219 (transpose-subr 'c-forward-subword arg)) |
220 | 220 |
221 | |
222 | |
223 (defun c-downcase-subword (arg) | |
224 "Do the same as `downcase-word' but on subwords. | |
225 See the command `c-subword-mode' for a description of subwords. | |
226 Optional argument ARG is the same as for `downcase-word'." | |
227 (interactive "p") | |
228 (let ((start (point))) | |
229 (downcase-region (point) (c-forward-subword arg)) | |
230 (when (< arg 0) | |
231 (goto-char start)))) | |
232 | |
233 (defun c-upcase-subword (arg) | |
234 "Do the same as `upcase-word' but on subwords. | |
235 See the command `c-subword-mode' for a description of subwords. | |
236 Optional argument ARG is the same as for `upcase-word'." | |
237 (interactive "p") | |
238 (let ((start (point))) | |
239 (upcase-region (point) (c-forward-subword arg)) | |
240 (when (< arg 0) | |
241 (goto-char start)))) | |
242 | |
221 (defun c-capitalize-subword (arg) | 243 (defun c-capitalize-subword (arg) |
222 "Do the same as `capitalize-word' but on subwords. | 244 "Do the same as `capitalize-word' but on subwords. |
223 See the command `c-subword-mode' for a description of subwords. | 245 See the command `c-subword-mode' for a description of subwords. |
224 Optional argument ARG is the same as for `capitalize-word'." | 246 Optional argument ARG is the same as for `capitalize-word'." |
225 (interactive "p") | 247 (interactive "p") |
235 (np (c-forward-subword direction))) | 257 (np (c-forward-subword direction))) |
236 (upcase-region p pp) | 258 (upcase-region p pp) |
237 (downcase-region pp np) | 259 (downcase-region pp np) |
238 (goto-char np))))) | 260 (goto-char np))))) |
239 | 261 |
240 (defun c-downcase-subword (arg) | |
241 "Do the same as `downcase-word' but on subwords. | |
242 See the command `c-subword-mode' for a description of subwords. | |
243 Optional argument ARG is the same as for `downcase-word'." | |
244 (interactive "p") | |
245 (downcase-region (point) (c-forward-subword arg))) | |
246 | |
247 (defun c-upcase-subword (arg) | |
248 "Do the same as `upcase-word' but on subwords. | |
249 See the command `c-subword-mode' for a description of subwords. | |
250 Optional argument ARG is the same as for `upcase-word'." | |
251 (interactive "p") | |
252 (upcase-region (point) (c-forward-subword arg))) | |
253 | 262 |
254 | 263 |
255 ;; | 264 ;; |
256 ;; Internal functions | 265 ;; Internal functions |
257 ;; | 266 ;; |