emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r114662: * lisp/progmodes/subword.el (subword-capitalize): Be careful when
Date: Mon, 14 Oct 2013 19:20:45 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114662
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: Mon 2013-10-14 15:20:29 -0400
message:
  * lisp/progmodes/subword.el (subword-capitalize): Be careful when
  the search for [[:alpha:]] fails.
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-14 15:37:12 +0000
+++ b/lisp/ChangeLog    2013-10-14 19:20:29 +0000
@@ -1,3 +1,8 @@
+2013-10-14  Dima Kogan  <address@hidden>  (tiny change)
+
+       * progmodes/subword.el (subword-capitalize): Be careful when
+       the search for [[:alpha:]] fails (bug#15580).
+
 2013-10-14  Eli Zaretskii  <address@hidden>
 
        * menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks
@@ -5,8 +10,8 @@
 
 2013-10-14  Dmitry Gutov  <address@hidden>
 
-       * progmodes/ruby-mode.el (ruby-smie--args-separator-p): Handle
-       methods ending with `?' and `!'.
+       * progmodes/ruby-mode.el (ruby-smie--args-separator-p):
+       Handle methods ending with `?' and `!'.
 
 2013-10-14  Akinori MUSHA  <address@hidden>
 
@@ -41,8 +46,8 @@
        Fix indentation/fontification of Java enum with
        "implements"/generic.
 
-       * progmodes/cc-engine.el (c-backward-over-enum-header): Extracted
-       from the three other places and enhanced to handle generics.
+       * progmodes/cc-engine.el (c-backward-over-enum-header):
+       Extracted from the three other places and enhanced to handle generics.
        (c-inside-bracelist-p): Uses new function above.
        * progmodes/cc-fonts.el (c-font-lock-declarations): Uses new
        function above.
@@ -230,8 +235,8 @@
 
        * tooltip.el (tooltip-mode): Don't error out on TTYs.
 
-       * menu-bar.el (popup-menu, popup-menu-normalize-position): Moved
-       here from mouse.el.
+       * menu-bar.el (popup-menu, popup-menu-normalize-position):
+       Move here from mouse.el.
        (popup-menu): Support menu-bar navigation on TTYs using C-f/C-b
        and arrow keys.
        (tty-menu-navigation-map): New map for TTY menu navigation.

=== modified file 'lisp/progmodes/subword.el'
--- a/lisp/progmodes/subword.el 2013-07-22 16:25:32 +0000
+++ b/lisp/progmodes/subword.el 2013-10-14 19:20:29 +0000
@@ -257,24 +257,25 @@
 See the command `subword-mode' for a description of subwords.
 Optional argument ARG is the same as for `capitalize-word'."
   (interactive "p")
-  (let ((count (abs arg))
-       (start (point))
-       (advance (if (< arg 0) nil t)))
-    (dotimes (i count)
-      (if advance
-         (progn (re-search-forward
-                 (concat "[[:alpha:]]")
-                 nil t)
-                (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))))
+  (catch 'search-failed
+    (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)))))
 
 
 


reply via email to

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