summaryrefslogtreecommitdiff
path: root/modules/custom-case.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-10-22 12:27:05 -0500
committerCraig Jennings <c@cjennings.net>2025-10-22 12:27:05 -0500
commitc4e9232f297ffda4443477c589f29052178d2c87 (patch)
treef4c50c999bf18a57e08c439ad244b23b006d0730 /modules/custom-case.el
parent2a543ea6a0fd018a24008fba514a6967c3f62cfb (diff)
feat: undead-buffers: Add `cj/make-buffer-undead` function and tests
Introduce a new function `cj/make-buffer-undead` that appends a buffer name to the `cj/undead-buffer-list`, preventing it from being killed. This comes along with a suite of tests to check various scenarios and edge cases for handling undead buffers. Additionally, add tests for related functions: `cj/kill-buffer-or-bury-alive`, `cj/kill-buffer-and-window`, and others to ensure they correctly manage buffers, particularly with undead-status considerations. Refactor `undead-buffer-list` naming for consistency and clarity in the module.
Diffstat (limited to 'modules/custom-case.el')
-rw-r--r--modules/custom-case.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/modules/custom-case.el b/modules/custom-case.el
index 75ceb184..4fd9ac05 100644
--- a/modules/custom-case.el
+++ b/modules/custom-case.el
@@ -40,12 +40,11 @@
(defun cj/title-case-region ()
"Capitalize the region in title case format.
-Title case is a capitalization convention where major words
-are capitalized,and most minor words are lowercase. Nouns,
-verbs (including linking verbs), adjectives, adverbs,pronouns,
-and all words of four letters or more are considered major words.
-Short (i.e., three letters or fewer) conjunctions, short prepositions,
-and all articles are considered minor words."
+Title case is a capitalization convention where major words are capitalized,
+and most minor words are lowercase. Nouns, verbs (including linking verbs),
+adjectives, adverbs,pronouns, and all words of four letters or more are
+considered major words. Short (i.e., three letters or fewer) conjunctions,
+short prepositions, and all articles are considered minor words."
(interactive)
(let ((beg nil)
(end nil)
@@ -112,11 +111,14 @@ and all articles are considered minor words."
;; Case-change operations prefix and keymap
(defvar-keymap cj/case-map
- :doc "Keymap for case-change operations."
+ :doc "Keymap for case-change operations"
"t" #'cj/title-case-region
"u" #'cj/upcase-dwim
"l" #'cj/downcase-dwim)
(keymap-set cj/custom-keymap "c" cj/case-map)
+(with-eval-after-load 'which-key
+ (which-key-add-key-based-replacements "C-; c" "case change menu"))
+
(provide 'custom-case)
;;; custom-case.el ends here.