>From b3d45ce893aa51f9fd7175a70003dca5571be9d2 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Tue, 15 Oct 2013 11:54:56 -0700 Subject: [PATCH] Correction to the recent subword-capitalize fix This applies to emacs bug 15580 --- lisp/progmodes/subword.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el index 1232588..0d754d5 100644 --- a/lisp/progmodes/subword.el +++ b/lisp/progmodes/subword.el @@ -257,7 +257,7 @@ Optional argument ARG is the same as for `upcase-word'." 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 + (condition-case nil (let ((count (abs arg)) (start (point)) (advance (>= arg 0))) @@ -265,7 +265,7 @@ Optional argument ARG is the same as for `capitalize-word'." (dotimes (i count) (if advance (progn - (search-forward "[[:alpha:]]") + (re-search-forward "[[:alpha:]]") (goto-char (match-beginning 0))) (subword-backward)) (let* ((p (point)) @@ -275,7 +275,8 @@ Optional argument ARG is the same as for `capitalize-word'." (downcase-region pp np) (goto-char (if advance np p)))) (unless advance - (goto-char start))))) + (goto-char start))) + (search-failed nil))) -- 1.8.3.2