summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-10-22 23:54:42 -0500
committerCraig Jennings <c@cjennings.net>2025-10-22 23:54:42 -0500
commitba211d51f487b07303b6c892fbc9d1c97b439ea2 (patch)
tree569ddcdeb5493b5258ebc67c14d22ab7bac75b9c
parente73ed3693ea61d53eb40c40d870e6385dabed206 (diff)
refactor:custom-line-paragraph:: Remove expand-region demand
Remove the demand for expand-region package and require it in `cj/join-paragraph` function instead. This streamlines the package loading process and keeps its usage localized to the part of the code that actually needs it.
-rw-r--r--modules/custom-line-paragraph.el8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/custom-line-paragraph.el b/modules/custom-line-paragraph.el
index cb89a6f5..a23199e7 100644
--- a/modules/custom-line-paragraph.el
+++ b/modules/custom-line-paragraph.el
@@ -18,10 +18,6 @@
;;; Code:
-
-(use-package expand-region
- :demand t) ;; used w/in join paragraph
-
(defun cj/join-line-or-region ()
"Join lines in the active region or join the current line with the previous one."
(interactive)
@@ -36,12 +32,14 @@
;; No region - only join if there's a previous line
(when (> (line-number-at-pos) 1)
(join-line))
+ (end-of-line)
(newline)))
(defun cj/join-paragraph ()
"Join all lines in the current paragraph using `cj/join-line-or-region'."
(interactive)
- (er/mark-paragraph) ;; from package expand region
+ (require 'expand-region)
+ (er/mark-paragraph)
(cj/join-line-or-region)
(forward-line))