]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid infinite loop in 'studlify-word'
authorMarcin Borkowski <mbork@mbork.pl>
Fri, 8 Apr 2016 07:57:21 +0000 (10:57 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 8 Apr 2016 07:57:21 +0000 (10:57 +0300)
* lisp/play/studly.el (studlify-region): Call
'forward-word-strictly' and 'backward-word-strictly' instead of
'forward-word' and 'backward-word'.  (Bug#19940)

lisp/play/studly.el

index f6aae4548b11b84cd61e2775605e3f457fcfade9..ff1bf03e118a402091ba5061dbcd57fc66c3eec5 100644 (file)
     (setq begin (point))
     (while (and (<= (point) end)
                (not (looking-at "\\W*\\'")))
-      (forward-word 1)
-      (backward-word 1)
+      (forward-word-strictly 1)
+      (backward-word-strictly 1)
       (setq begin (max (point) begin))
-      (forward-word 1)
+      (forward-word-strictly 1)
       (let ((offset 0)
            (word-end (min (point) end))
            c)
@@ -55,7 +55,7 @@
   "Studlify-case the current word, or COUNT words if given an argument."
   (interactive "*p")
   (let ((begin (point)) end rb re)
-    (forward-word count)
+    (forward-word-strictly count)
     (setq end (point))
     (setq rb (min begin end) re (max begin end))
     (studlify-region rb re)))