From 73f7656d02f916c361fc0da06d97d9bdaf9062a0 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 27 May 2026 18:26:58 -0500 Subject: feat(compose): open compose and conflict buffers in a configurable side window The compose buffers (edit-description, add-comment) and the smerge conflict buffer popped wherever display-buffer happened to put them. Now they open in a side window, defaulting to the bottom at 30% of the frame, with two defcustoms to control it: pearl-compose-window-side (bottom / top / left / right) and pearl-compose-window-size (a fraction of the frame, or an absolute line/column count). pearl--compose-display-action builds the display-buffer-in-side-window action and both pop sites pass it through pop-to-buffer, so Pearl always applies the side window over any display-buffer-alist entry for these buffers. --- tests/test-pearl-compose.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests') diff --git a/tests/test-pearl-compose.el b/tests/test-pearl-compose.el index 7029297..3e62c09 100644 --- a/tests/test-pearl-compose.el +++ b/tests/test-pearl-compose.el @@ -149,5 +149,28 @@ Binds `captured' to the value the on-finish receives (or `:none'). Stubs (goto-char (point-min)) (should (re-search-forward "Edited description" nil t)))))) +;;; compose-window display action + +(ert-deftest test-pearl-compose-display-action-defaults-to-bottom-fraction () + "By default the compose window opens at the bottom, sized to 30% of the frame." + (should (equal '((display-buffer-in-side-window) (side . bottom) (window-height . 0.3)) + (pearl--compose-display-action)))) + +(ert-deftest test-pearl-compose-display-action-honors-side-and-size () + "The side and size defcustoms drive the action; left/right size the width, +top/bottom the height, and the size passes through as float or integer." + (let ((pearl-compose-window-side 'right) + (pearl-compose-window-size 40)) + (should (equal '((display-buffer-in-side-window) (side . right) (window-width . 40)) + (pearl--compose-display-action)))) + (let ((pearl-compose-window-side 'top) + (pearl-compose-window-size 0.25)) + (should (equal '((display-buffer-in-side-window) (side . top) (window-height . 0.25)) + (pearl--compose-display-action)))) + (let ((pearl-compose-window-side 'left) + (pearl-compose-window-size 0.2)) + (should (equal '((display-buffer-in-side-window) (side . left) (window-width . 0.2)) + (pearl--compose-display-action))))) + (provide 'test-pearl-compose) ;;; test-pearl-compose.el ends here -- cgit v1.2.3