From 2b7ee267f564d58a17bb13767b6f5f73f75547ad Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 21:09:27 -0600 Subject: Skip word forward --- lisp/+casing.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lisp/+casing.el') diff --git a/lisp/+casing.el b/lisp/+casing.el index bcab7fa..115cb43 100644 --- a/lisp/+casing.el +++ b/lisp/+casing.el @@ -21,7 +21,9 @@ Otherwise, it calls `upcase-word' on the word at point (using (if (use-region-p) (upcase-region (region-beginning) (region-end) (region-noncontiguous-p)) (let ((following (1- arg)) - (word-bound (bounds-of-thing-at-point 'word))) + (word-bound (save-excursion + (skip-chars-forward "^[:word:]") + (bounds-of-thing-at-point 'word)))) (upcase-region (car word-bound) (cdr word-bound)) (goto-char (cdr word-bound)) (upcase-word following)))) @@ -36,7 +38,9 @@ Otherwise, it calls `downcase-word' on the word at point (using (if (use-region-p) (downcase-region (region-beginning) (region-end) (region-noncontiguous-p)) (let ((following (1- arg)) - (word-bound (bounds-of-thing-at-point 'word))) + (word-bound (save-excursion + (skip-chars-forward "^[:word:]") + (bounds-of-thing-at-point 'word)))) (downcase-region (car word-bound) (cdr word-bound)) (goto-char (cdr word-bound)) (downcase-word following)))) @@ -51,7 +55,9 @@ Otherwise, it calls `capitalize-word' on the word at point (using (if (use-region-p) (capitalize-region (region-beginning) (region-end) (region-noncontiguous-p)) (let ((following (1- arg)) - (word-bound (bounds-of-thing-at-point 'word))) + (word-bound (save-excursion + (skip-chars-forward "^[:word:]") + (bounds-of-thing-at-point 'word)))) (capitalize-region (car word-bound) (cdr word-bound)) (goto-char (cdr word-bound)) (capitalize-word following)))) -- cgit 1.4.1-21-gabe81