emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/cc-subword.el,v


From: Masatake YAMATO
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/cc-subword.el,v
Date: Mon, 09 Apr 2007 13:01:32 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Masatake YAMATO <jet>   07/04/09 13:01:31

Index: progmodes/cc-subword.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/cc-subword.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- progmodes/cc-subword.el     9 Apr 2007 12:34:57 -0000       1.7
+++ progmodes/cc-subword.el     9 Apr 2007 13:01:30 -0000       1.8
@@ -246,18 +246,23 @@
 Optional argument ARG is the same as for `capitalize-word'."
   (interactive "p")
   (let ((count (abs arg))
-       (direction (if (< 0 arg) 1 -1)))
+       (start (point))
+       (advance (if (< arg 0) nil t)))
     (dotimes (i count)
-      (when (re-search-forward
+      (if advance
+         (progn (re-search-forward
             (concat "[" c-alpha "]")
             nil t)
        (goto-char (match-beginning 0)))
+       (c-backward-subword))
       (let* ((p (point))
             (pp (1+ p))
-            (np (c-forward-subword direction)))
+            (np (c-forward-subword)))
        (upcase-region p pp)
        (downcase-region pp np)
-       (goto-char np)))))
+       (goto-char (if advance np p))))
+    (unless advance
+      (goto-char start))))
 
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]