+2013-10-16 Dima Kogan <dima@secretsauce.net> (tiny change)
+
+ * progmodes/subword.el (subword-capitalize): Fix Stefan's mess
+ (bug#15580).
+
2013-10-16 Glenn Morris <rgm@gnu.org>
* ansi-color.el (ansi-color-drop-regexp):
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)))
-
- (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)))))
+ (condition-case nil
+ (let ((count (abs arg))
+ (start (point))
+ (advance (>= arg 0)))
+
+ (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)))
\f