diff options
Diffstat (limited to 'lisp/+casing.el')
-rw-r--r-- | lisp/+casing.el | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lisp/+casing.el b/lisp/+casing.el index 5f39b2e..c8e9e4d 100644 --- a/lisp/+casing.el +++ b/lisp/+casing.el | |||
@@ -3,7 +3,6 @@ | |||
3 | ;;; Code: | 3 | ;;; Code: |
4 | 4 | ||
5 | (require 'thingatpt) | 5 | (require 'thingatpt) |
6 | (require '+key) | ||
7 | 6 | ||
8 | ;;;###autoload | 7 | ;;;###autoload |
9 | (defun +upcase-dwim (arg) | 8 | (defun +upcase-dwim (arg) |
@@ -61,21 +60,23 @@ Otherwise, it calls `capitalize-word' on the word at point (using | |||
61 | 60 | ||
62 | ;; Later on, I'll add repeat maps and stuff in here... | 61 | ;; Later on, I'll add repeat maps and stuff in here... |
63 | 62 | ||
63 | (defvar +casing-map (let ((map (make-sparse-keymap))) | ||
64 | (define-key map "u" #'+upcase-dwim) | ||
65 | (define-key map (kbd "M-u") #'+upcase-dwim) | ||
66 | (define-key map "l" #'+downcase-dwim) | ||
67 | (define-key map (kbd "M-l") #'+downcase-dwim) | ||
68 | (define-key map "c" #'+capitalize-dwim) | ||
69 | (define-key map (kbd "M-c") #'+capitalize-dwim) | ||
70 | map) | ||
71 | "Keymap for case-related twiddling.") | ||
72 | |||
64 | (define-minor-mode +casing-mode | 73 | (define-minor-mode +casing-mode |
65 | "Enable easy case-twiddling commands." | 74 | "Enable easy case-twiddling commands." |
66 | :lighter " cC" | 75 | :lighter " cC" |
76 | :global t | ||
67 | :keymap (let ((map (make-sparse-keymap))) | 77 | :keymap (let ((map (make-sparse-keymap))) |
68 | (define-key map "u" #'+upcase-dwim) | 78 | (define-key map (kbd "M-c") +casing-map) |
69 | (define-key map (kbd "M-u") #'+upcase-dwim) | 79 | map)) |
70 | (define-key map "l" #'+downcase-dwim) | ||
71 | (define-key map (kbd "M-l") #'+downcase-dwim) | ||
72 | (define-key map "c" #'+capitalize-dwim) | ||
73 | (define-key map (kbd "M-c") #'+capitalize-dwim) | ||
74 | map) | ||
75 | (define-key +key-mode-map (kbd "M-c") (when +casing-mode | ||
76 | +casing-mode-map))) | ||
77 | |||
78 | (defvaralias '+casing-map '+casing-mode-map) | ||
79 | 80 | ||
80 | (provide '+casing) | 81 | (provide '+casing) |
81 | ;;; +casing.el ends here | 82 | ;;; +casing.el ends here |