diff options
author | Marcin Borkowski <mbork@mbork.pl> | 2016-04-08 10:57:21 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2016-04-08 10:57:21 +0300 |
commit | a3f1ac2e3b546951f3182a7b42cad7f64a94e0b8 (patch) | |
tree | 3f1ce365beaf021b2286c627d2f4fe1f56b7d2f5 | |
parent | f36df4b97ba6f335c24ada099203a9244ac84ce5 (diff) |
Avoid infinite loop in 'studlify-word'
* lisp/play/studly.el (studlify-region): Call
'forward-word-strictly' and 'backward-word-strictly' instead of
'forward-word' and 'backward-word'. (Bug#19940)
-rw-r--r-- | lisp/play/studly.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/play/studly.el b/lisp/play/studly.el index f6aae4548b..ff1bf03e11 100644 --- a/lisp/play/studly.el +++ b/lisp/play/studly.el @@ -25,10 +25,10 @@ (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))) |