emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114680: * lisp/progmodes/subword.el (subword-capita


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r114680: * lisp/progmodes/subword.el (subword-capitalize): Fix Stefan's mess.
Date: Wed, 16 Oct 2013 03:02:44 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114680
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15580
author: Dima Kogan <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2013-10-15 23:02:40 -0400
message:
  * lisp/progmodes/subword.el (subword-capitalize): Fix Stefan's mess.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/subword.el      subword.el-20091121171556-bypaf8oo9ygoo13w-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-10-16 01:38:12 +0000
+++ b/lisp/ChangeLog    2013-10-16 03:02:40 +0000
@@ -1,3 +1,8 @@
+2013-10-16  Dima Kogan  <address@hidden>  (tiny change)
+
+       * progmodes/subword.el (subword-capitalize): Fix Stefan's mess
+       (bug#15580).
+
 2013-10-16  Glenn Morris  <address@hidden>
 
        * ansi-color.el (ansi-color-drop-regexp):

=== modified file 'lisp/progmodes/subword.el'
--- a/lisp/progmodes/subword.el 2013-10-14 19:20:29 +0000
+++ b/lisp/progmodes/subword.el 2013-10-16 03:02:40 +0000
@@ -257,25 +257,26 @@
 See the command `subword-mode' for a description of subwords.
 Optional argument ARG is the same as for `capitalize-word'."
   (interactive "p")
-  (catch 'search-failed
-    (let ((count (abs arg))
-          (start (point))
-          (advance (>= arg 0)))
+  (condition-case nil
+      (let ((count (abs arg))
+            (start (point))
+            (advance (>= arg 0)))
 
-      (dotimes (i count)
-        (if advance
-            (progn
-              (search-forward "[[:alpha:]]")
-              (goto-char (match-beginning 0)))
-          (subword-backward))
-        (let* ((p (point))
-               (pp (1+ p))
-               (np (subword-forward)))
-          (upcase-region p pp)
-          (downcase-region pp np)
-          (goto-char (if advance np p))))
-      (unless advance
-        (goto-char start)))))
+        (dotimes (i count)
+          (if advance
+              (progn
+                (re-search-forward "[[:alpha:]]")
+                (goto-char (match-beginning 0)))
+            (subword-backward))
+          (let* ((p (point))
+                 (pp (1+ p))
+                 (np (subword-forward)))
+            (upcase-region p pp)
+            (downcase-region pp np)
+            (goto-char (if advance np p))))
+        (unless advance
+          (goto-char start)))
+    (search-failed nil)))
 
 
 


reply via email to

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