summaryrefslogtreecommitdiff
path: root/modules/custom-case.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/custom-case.el')
-rw-r--r--modules/custom-case.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/custom-case.el b/modules/custom-case.el
index 59250ddb..a4e0c0e0 100644
--- a/modules/custom-case.el
+++ b/modules/custom-case.el
@@ -79,12 +79,15 @@ short prepositions, and all articles are considered minor words."
(while (< (point) end)
(setq prev-word-end (point))
(skip-chars-forward (concat "^" word-chars) end)
+ (when (>= (point) end) ;; no word chars remaining
+ (goto-char end))
(let ((word-end
(save-excursion
(skip-chars-forward word-chars end)
(point))))
- (unless (memq (char-before (point)) chars-separator)
+ (unless (or (>= (point) end)
+ (memq (char-before (point)) chars-separator))
(let* ((c-orig (char-to-string (char-after (point))))
(c-up (capitalize c-orig)))
(unless (string-equal c-orig c-up)