|
23 | 23 |
|
24 | 24 | ;;; Commentary: |
25 | 25 |
|
26 | | -;; Main functions are three |
| 26 | +;; There are three main functions: |
27 | 27 | ;; |
28 | 28 | ;; 1. For Ruby -> string-inflection-ruby-style-cycle (foo_bar => FOO_BAR => FooBar => foo_bar) |
29 | 29 | ;; 2. For Python -> string-inflection-python-style-cycle (foo_bar => FOO_BAR => FooBar => foo_bar) |
30 | 30 | ;; 3. For Java -> string-inflection-java-style-cycle (fooBar => FOO_BAR => FooBar => fooBar) |
31 | 31 | ;; 4. For All -> string-inflection-all-cycle (foo_bar => FOO_BAR => FooBar => fooBar => foo-bar => Foo_Bar => foo_bar) |
32 | 32 | ;; |
33 | 33 | ;; |
34 | | -;; Setting Example 1 |
| 34 | +;; Example 1: |
35 | 35 | ;; |
36 | 36 | ;; (require 'string-inflection) |
37 | 37 | ;; (global-unset-key (kbd "C-q")) |
|
56 | 56 | ;; (string-inflection-ruby-style-cycle)))) |
57 | 57 | ;; |
58 | 58 | ;; |
59 | | -;; Setting Example 2 |
| 59 | +;; Example 2: |
60 | 60 | ;; |
61 | 61 | ;; (require 'string-inflection) |
62 | 62 | ;; |
|
78 | 78 | ;; '(lambda () |
79 | 79 | ;; (local-set-key (kbd "C-c C-u") 'string-inflection-java-style-cycle))) |
80 | 80 | ;; |
81 | | -;; You may also consider setting `string-inflection-skip-backward-when-done' to |
82 | | -;; `t' if you don't like `string-inflect' moving your point to the end of the |
83 | | -;; word |
| 81 | +;; You can also set `string-inflection-skip-backward-when-done' to `t' if |
| 82 | +;; you don't like `string-inflect' moving your point to the end of the word. |
84 | 83 |
|
85 | 84 | ;;; Code: |
86 | 85 |
|
87 | | -(defconst string-inflection-word-chars "a-zA-Z0-9_-") |
| 86 | +(defgroup string-inflection nil |
| 87 | + "Change the casing of words." |
| 88 | + :group 'convenience) |
| 89 | + |
| 90 | +(defcustom string-inflection-skip-backward-when-done nil |
| 91 | + "Controls the position of the cursor after an inflection. |
88 | 92 |
|
89 | | -(defvar string-inflection-skip-backward-when-done nil |
90 | | - "Whether point just move backward to the beginning of the word after inflecting.") |
| 93 | +If nil remain at the end of the string after inflecting, else move backward to |
| 94 | +the beginning." |
| 95 | + :group 'string-inflection |
| 96 | + :type 'boolean) |
| 97 | + |
| 98 | +(defconst string-inflection-word-chars "a-zA-Z0-9_-") |
91 | 99 |
|
92 | 100 | ;; -------------------------------------------------------------------------------- |
93 | 101 |
|
|
0 commit comments