From 0e00229f5b4aa186456027e37c8962a3b09ea3f5 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 20 Oct 2025 09:49:22 -0500 Subject: refactor: custom-text-enclose: update key binding syntax - Replace `define-key` with `keymap-set` for setting key bindings in the `custom-keymap`. --- modules/custom-text-enclose.el | 20 +++++++++++++++----- 1 file 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. -- cgit v1.2.3