aboutsummaryrefslogtreecommitdiff
path: root/modules/custom-line-paragraph.el
Commit message (Collapse)AuthorAgeFilesLines
* fix(line-paragraph): join-line-or-region strands space on next lineCraig Jennings2026-05-031-4/+10
| | | | | | | | | | The region branch's `(while (< (point) end) (join-line 1))` ran one iteration too many. After the final in-region join, point sat just before the end marker, so the loop fired once more. That extra `join-line 1` consumed the next line's preceding newline and replaced it with a space. Then `(goto-char end)` + `(newline)` reinserted a newline at the original end position, before the inserted space, so the space ended up stranded at BOL of the next line. I replaced the position-based loop with `count-lines` + `dotimes` to do exactly the right number of joins. I also swapped the trailing `(newline)` for `(forward-line 1)`. The bullet-list use case now lands directly on the next existing line with no blank gap. The trailing-newline change ripples to `cj/join-paragraph` (which delegates here), so paragraphs now also stop adding a trailing newline when the input lacks one. `require-final-newline` handles file-end discipline on save anyway. I added 3 new tests that fail against the old loop and pass against the fix. I also updated 11 existing tests whose assertions baked in the old trailing-newline behavior. While in there I wrapped the `cj/custom-keymap` defvar stub in `eval-and-compile` in both test files. The bare defvar wasn't evaluated at byte-compile time, so the `require` of `custom-line-paragraph` would hit a void symbol when the validate-el hook ran.
* feat:which-key: Add descriptive labels for custom keymapsCraig Jennings2025-10-271-2/+9
| | | | | | | | | | | | Enhance which-key integration by providing detailed descriptions for new key bindings across multiple modules. This improves the usability of custom keymaps by clarifying the purpose of each keybinding, making it easier for users to navigate and understand different menus and options available within the configuration. This update ensures that all custom keymaps now display a descriptive label in the which-key popup to explain their functionality, aiding users in identifying keymap purposes promptly.
* docs:custom-line-paragraph: Update author info, enhance commentaryCraig Jennings2025-10-261-6/+5
| | | | | | Add author information and improve commentary to detail line and paragraph manipulation utilities more clearly, enhancing the module's documentation.
* fix:custom-line-paragraph:missing forward declarationsCraig Jennings2025-10-261-0/+3
|
* feat:custom-line-paragraph: add keybinding for duplicate-and-commentCraig Jennings2025-10-261-2/+4
| | | | | | - Add C-; l c keybinding to duplicate line/region with commenting - Add which-key description "duplicate and comment" for the new binding - Complements existing C-; l d (duplicate without comment)
* fix+test:custom-line-paragraph:infinite loop remove-lines-containingCraig Jennings2025-10-261-21/+23
| | | | | | | - Add guard clause to handle empty string input gracefully (would cause infinite loop) - Add 33 comprehensive tests covering normal cases, boundary cases, and error cases - Tests verify Unicode support, regex character escaping, region vs buffer operations - All 33 tests passing
* test:custom-line-paragraph: add tests and fix region deactivationCraig Jennings2025-10-261-1/+2
| | | | | | - Add 11 new tests for cj/join-line-or-region covering boundary cases, Unicode, stress testing, and undo behavior - Fix region deactivation in cj/join-line-or-region function - All 62 tests now passing (41 join-line-or-region + 21 join-paragraph)
* refactor:custom-line-paragraph:: Remove expand-region demandCraig Jennings2025-10-221-5/+3
| | | | | | | 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.
* feat: undead-buffers: Add `cj/make-buffer-undead` function and testsCraig Jennings2025-10-221-69/+73
| | | | | | | | | | | | | | | 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.
* doc: Improved CommentaryCraig Jennings2025-10-201-1/+13
|
* refactor: keymap: Use defvar-keymap and keymap-setCraig Jennings2025-10-171-17/+15
| | | | | | | - Replace define-prefix-command/define-key with defvar-keymap and keymap-set - Preserve existing bindings under cj/custom-keymap "l" - Tidy docstrings and reflow long lines - No functional changes
* fix: call cj/join-line-or-region with 0 (correct number) argsCraig Jennings2025-10-121-1/+1
|
* maint: remaining custom functions grouped into separate modulesCraig Jennings2025-10-121-0/+127