diff options
-rw-r--r-- | lisp/+casing.el | 12 |
1 files changed, 9 insertions, 3 deletions
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 | |||
21 | (if (use-region-p) | 21 | (if (use-region-p) |
22 | (upcase-region (region-beginning) (region-end) (region-noncontiguous-p)) | 22 | (upcase-region (region-beginning) (region-end) (region-noncontiguous-p)) |
23 | (let ((following (1- arg)) | 23 | (let ((following (1- arg)) |
24 | (word-bound (bounds-of-thing-at-point 'word))) | 24 | (word-bound (save-excursion |
25 | (skip-chars-forward "^[:word:]") | ||
26 | (bounds-of-thing-at-point 'word)))) | ||
25 | (upcase-region (car word-bound) (cdr word-bound)) | 27 | (upcase-region (car word-bound) (cdr word-bound)) |
26 | (goto-char (cdr word-bound)) | 28 | (goto-char (cdr word-bound)) |
27 | (upcase-word following)))) | 29 | (upcase-word following)))) |
@@ -36,7 +38,9 @@ Otherwise, it calls `downcase-word' on the word at point (using | |||
36 | (if (use-region-p) | 38 | (if (use-region-p) |
37 | (downcase-region (region-beginning) (region-end) (region-noncontiguous-p)) | 39 | (downcase-region (region-beginning) (region-end) (region-noncontiguous-p)) |
38 | (let ((following (1- arg)) | 40 | (let ((following (1- arg)) |
39 | (word-bound (bounds-of-thing-at-point 'word))) | 41 | (word-bound (save-excursion |
42 | (skip-chars-forward "^[:word:]") | ||
43 | (bounds-of-thing-at-point 'word)))) | ||
40 | (downcase-region (car word-bound) (cdr word-bound)) | 44 | (downcase-region (car word-bound) (cdr word-bound)) |
41 | (goto-char (cdr word-bound)) | 45 | (goto-char (cdr word-bound)) |
42 | (downcase-word following)))) | 46 | (downcase-word following)))) |
@@ -51,7 +55,9 @@ Otherwise, it calls `capitalize-word' on the word at point (using | |||
51 | (if (use-region-p) | 55 | (if (use-region-p) |
52 | (capitalize-region (region-beginning) (region-end) (region-noncontiguous-p)) | 56 | (capitalize-region (region-beginning) (region-end) (region-noncontiguous-p)) |
53 | (let ((following (1- arg)) | 57 | (let ((following (1- arg)) |
54 | (word-bound (bounds-of-thing-at-point 'word))) | 58 | (word-bound (save-excursion |
59 | (skip-chars-forward "^[:word:]") | ||
60 | (bounds-of-thing-at-point 'word)))) | ||
55 | (capitalize-region (car word-bound) (cdr word-bound)) | 61 | (capitalize-region (car word-bound) (cdr word-bound)) |
56 | (goto-char (cdr word-bound)) | 62 | (goto-char (cdr word-bound)) |
57 | (capitalize-word following)))) | 63 | (capitalize-word following)))) |