diff options
| author | Craig Jennings <c@cjennings.net> | 2025-10-20 09:49:22 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-10-20 09:49:22 -0500 |
| commit | 0e00229f5b4aa186456027e37c8962a3b09ea3f5 (patch) | |
| tree | abc76f1f5d000bf3b71ab876ea461d61b2fda04c | |
| parent | 434946b0bdfed4964ea8e0815ff1387ef330c5a8 (diff) | |
refactor: custom-text-enclose: update key binding syntax
- Replace `define-key` with `keymap-set` for setting key bindings in the `custom-keymap`.
| -rw-r--r-- | modules/custom-text-enclose.el | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/modules/custom-text-enclose.el b/modules/custom-text-enclose.el index 7c3f2135..fa41d39f 100644 --- a/modules/custom-text-enclose.el +++ b/modules/custom-text-enclose.el @@ -1,7 +1,17 @@ ;;; custom-text-enclose.el --- -*- coding: utf-8; lexical-binding: t; -*- ;;; Commentary: -;; + +;; This module provides functions to surround words or regions with custom strings, and to append or prepend text to lines. + +;; It includes three main functions: +;; - surround word or region with a user-specified string +;; - append text to the end of lines +;; - prepend text to the beginning of lines + +;; All functions work on both the active region and the entire buffer when no region is selected. + +;; Bound to keymap prefix C-; s ;;; Code: @@ -61,10 +71,10 @@ ;; Surround, append, prepend prefix keymap (define-prefix-command 'cj/enclose-map nil "Keymap for enclosing text: surrounding, appending, and prepending.") -(define-key cj/custom-keymap "s" 'cj/enclose-map) -(define-key cj/enclose-map "s" 'cj/surround-word-or-region) -(define-key cj/enclose-map "a" 'cj/append-to-lines-in-region-or-buffer) -(define-key cj/enclose-map "p" 'cj/prepend-to-lines-in-region-or-buffer) +(keymap-set cj/custom-keymap "s" #'cj/enclose-map) +(keymap-set cj/enclose-map "s" #'cj/surround-word-or-region) +(keymap-set cj/enclose-map "a" #'cj/append-to-lines-in-region-or-buffer) +(keymap-set cj/enclose-map "p" #'cj/prepend-to-lines-in-region-or-buffer) (provide 'custom-text-enclose) ;;; custom-text-enclose.el ends here. |
